-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #23
Develop #23
Conversation
Feature/optimizations
Update deployment order in ci-cd.yml
Fix deployment command in ci-cd.yml #2
Co-authored-by: CodiumAI-Agent <[email protected]> Signed-off-by: Noah Rijkaard <[email protected]>
Update cutout creation and annotation process
…into-seperate-file 19 move cutout class back into seperate file
…re-for-deploying-modal Update deployment configuration
WalkthroughThe project has undergone a CI/CD enhancement for the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files selected for processing (13)
- .github/workflows/ci-cd.yml (2 hunks)
- .pre-commit-config.yaml (1 hunks)
- .pylintrc (1 hunks)
- app/common/init.py (1 hunks)
- app/cutout_handler/init.py (1 hunks)
- app/cutout_handler/dino.py (2 hunks)
- app/cutout_handler/grounded_cutouts.py (1 hunks)
- app/cutout_handler/s3_handler.py (2 hunks)
- app/cutout_handler/segment.py (1 hunks)
- app/cutout_handler/server.py (1 hunks)
- app/s3_handler/app.py (8 hunks)
- app/s3_handler/s3_handler.py (2 hunks)
- legacy_code/cutouts.py (2 hunks)
Files skipped from review due to trivial changes (3)
- .pylintrc
- app/s3_handler/app.py
- app/s3_handler/s3_handler.py
Additional comments: 15
app/cutout_handler/__init__.py (1)
- 1-3: Verify that the imported
cutout_handler_stub
,s3_handler_stub
, andcutout_app
are used within this module or elsewhere if this module is imported. Unused imports should be removed to keep the code clean..pre-commit-config.yaml (1)
- 1-10: The configuration for
black
andisort
is commented out. If these tools are intended to be used for code formatting, the configuration should be uncommented and active..github/workflows/ci-cd.yml (2)
4-7: The addition of the
develop
branch to the workflow triggers is a good practice for continuous integration, ensuring that the CI/CD process runs on updates to this branch as well.31-38: The new step to set environment variables dynamically based on the branch is a good practice for differentiating between deployment environments. Ensure that the downstream deployment scripts or commands are compatible with these new environment variables.
app/common/__init__.py (2)
1-36: The Docker image setup and the creation of stubs for
cutout_handler
ands3_handler
are well-structured, promoting modularity and reusability of the image configurations and service stubs.10-25: The use of
run_commands
to install dependencies and download weights is a clear and maintainable approach. However, ensure that the URLs for downloading weights are still valid and that the downloaded files are verified for integrity.app/cutout_handler/dino.py (2)
3-7: The addition of
cutout_handler_stub
andcutout_generator_image
imports should be verified for their usage within the module. If theModel
import fromgroundingdino.util.inference
was removed, ensure that it is no longer needed and that no code is left broken by its removal.13-13: The reformatted docstring for the
Dino
class improves readability and clarity.app/cutout_handler/s3_handler.py (1)
- 5-7: The restructuring of import statements to include
boto3
and exceptions frombotocore
within thes3_handler_image.imports()
context is appropriate if it's meant to ensure these imports are only available when the Docker image is being used.legacy_code/cutouts.py (2)
1-11: The reordering and importing of modules should be verified to ensure that all imports are used within the module. Unused imports should be removed to maintain clean code.
26-31: The reformatting of the
CutoutCreator
class's__init__
method improves readability and clarity.app/cutout_handler/grounded_cutouts.py (1)
- 1-16: The addition of imports should be verified to ensure that all imports are used within the module. Unused imports should be removed to maintain clean code.
app/cutout_handler/server.py (3)
1-26: The addition of imports and constants should be verified to ensure that they are used within the module. Unused imports should be removed, and constants should be validated for correctness.
32-41: The logging setup is a good practice for capturing and managing log output. Ensure that the logging configuration is consistent with the rest of the application.
56-62: The CORS middleware setup is important for controlling cross-origin requests. Verify that the specified origins align with the application's front-end deployment and security requirements.
|
||
|
||
class Segmenter: | ||
import numpy as np |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import statement for numpy
should be at the module level, not within the class definition, to follow Python's convention and improve readability.
- import numpy as np
+import numpy as np
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
import numpy as np | |
import numpy as np |
print(f"Successfully downloaded {image_name} to {file_path}") | ||
print("Directory contents:") | ||
print(os.listdir(save_path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition of print statements for debugging is useful for development, but consider using logging instead of print statements for better control over the output and its format.
- print(f"Successfully downloaded {image_name} to {file_path}")
- print("Directory contents:")
- print(os.listdir(save_path))
+ logger.info(f"Successfully downloaded {image_name} to {file_path}")
+ logger.debug("Directory contents: %s", os.listdir(save_path))
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
print(f"Successfully downloaded {image_name} to {file_path}") | |
print("Directory contents:") | |
print(os.listdir(save_path)) | |
logger.info(f"Successfully downloaded {image_name} to {file_path}") | |
logger.debug("Directory contents: %s", os.listdir(save_path)) |
Cleanup + improvements
Summary by CodeRabbit
New Features
develop
branch.black
andisort
.Documentation
.pylintrc
with new message control settings.Refactor
app/common
.app/cutout_handler
.app/cutout_handler
classes for better image processing and S3 interaction.app/cutout_handler/server.py
for image cutout creation and management.Bug Fixes
app/s3_handler/app.py
.Style