-
Notifications
You must be signed in to change notification settings - Fork 105
EXAMPLE/robot/lifelong_learning_bench/semantic-segmentation verified and updated. #242
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
base: main
Are you sure you want to change the base?
Conversation
1)the print is replaced with logger.in 2) hardcoded paths are removed with relative path 3) the readme made more detaled and clear Signed-off-by: RONAK <codeitronak226277@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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.
Summary of Changes
Hello @RONAK-AI647, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly enhances the usability and clarity of the semantic-segmentation example within the ianvs project. It addresses difficulties encountered during the example's execution by providing comprehensive documentation, streamlining setup processes, and improving code logging. The changes aim to make the example more accessible and understandable for new users, ensuring a smoother experience for anyone trying to learn or utilize Ianvs through this example.
Highlights
- Improved Documentation: The
README.mdfor the semantic segmentation example has been completely overhauled, featuring a detailed table of contents, clear prerequisites, and separate, step-by-step guides for both simple and large vision model (SAM) benchmarking. - Streamlined Setup: Instructions for Ianvs setup, virtual environment creation, and dataset preparation have been made more explicit, including direct Kaggle download links and expected dataset directory structures.
- Dependency Management: A new
requirements.txtfile has been added specifically for the semantic segmentation example, ensuring all necessary Python packages are easily installable. - Path Standardization: Hard-coded absolute paths in various configuration (
.yaml) files have been replaced with relative paths, improving portability and consistency across different environments. - Enhanced Logging: Numerous
printstatements across the Python codebase have been replaced withlogger.infocalls, providing more structured and monitorable output during execution. - Git Ignore Updates: Added
datasets/andworkspace/to.gitignoreto prevent unnecessary large files from being committed to the repository.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
Signed-off-by: RONAK <codeitronak226277@gmail.com>
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.
Code Review
This pull request significantly improves the documentation and usability of the semantic segmentation example by updating the README, removing some hardcoded paths, and replacing print statements with a structured logger. These are all valuable changes. However, the review identified several critical issues that need to be addressed. There are still hardcoded paths in the source code, which contradicts one of the main goals of this PR. The new requirements.txt uses latest for dependencies, which harms reproducibility. There's also a critical bug in eval.py due to an incorrect import update, and several configuration files contain invalid values. Addressing these points will greatly improve the quality and reliability of the example.
examples/robot/lifelong_learning_bench/semantic-segmentation/testalgorithms/rfnet/RFNet/eval.py
Show resolved
Hide resolved
examples/robot/lifelong_learning_bench/semantic-segmentation/requirements.txt
Show resolved
Hide resolved
examples/robot/lifelong_learning_bench/semantic-segmentation/requirements.txt
Show resolved
Hide resolved
examples/robot/lifelong_learning_bench/semantic-segmentation/testalgorithms/rfnet/RFNet/eval.py
Show resolved
Hide resolved
examples/robot/lifelong_learning_bench/semantic-segmentation/testenv/testenv-all.yaml
Show resolved
Hide resolved
examples/robot/lifelong_learning_bench/semantic-segmentation/testenv/testenv-city.yaml
Show resolved
Hide resolved
examples/robot/lifelong_learning_bench/semantic-segmentation/testenv/testenv.yaml
Show resolved
Hide resolved
| def train(self, train_data, valid_data=None, **kwargs): | ||
| self.trainer = Trainer(self.train_args, train_data=train_data) | ||
| print("Total epoches:", self.trainer.args.epochs) | ||
| logger.info("Total epoches:", self.trainer.args.epochs) |
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 logger's info method expects a single string argument for the message. Passing multiple arguments like this will result in a tuple being logged, which is likely not the intended format. Please use string formatting to combine the message and variables into a single string, for example: logger.info(f"Total epoches: {self.trainer.args.epochs}"). This issue is present in multiple files across this PR.
| logger.info("Total epoches:", self.trainer.args.epochs) | |
| logger.info(f"Total epoches: {self.trainer.args.epochs}") |
b3c83a1 to
abbd66a
Compare
|
I checked my fork had some mistakes and some wrong files which wee creating confusions. So , I renewed my fork with proper cloning this time , hence the prs are renewed. Thank You. |
| img_path = self.images[self.split][index].rstrip() | ||
| disp_path = self.disparities[self.split][index].rstrip() | ||
| #print(index) | ||
| #logger.info(index) |
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.
Commented-out code can be deleted directly.
| import mmcv | ||
| import pycocotools.mask as maskUtils | ||
| from mmdet.visualization.image import imshow_det_bboxes | ||
| from mmdet.visualization import DetLocalVisualizer |
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.
We need the module "imshow_det_bboxes" to visualize the results.
|
Could you show the results of running this example as expected? |
I was trying to run examples/robot/lifelong_learning_bench/semantic-segmentation to learn the use of Ianvs. However, the entire process of running this example was not so easy. So after many iterations and checks I have verified the example and updated the README.md so could any user can understand it well.
What type of PR is this?
/kind bug
/kind cleanup
/kind documentation
What this PR does / why we need it:
This PR verifies the example and well documents it. This PR involves :
1)Updating the README.md and seperating the parts of simple and sam model.
Verifying the exmpale by running it
2)Removing hard-coded paths
3)Sort out project dependencies and complete the documentation, especially 4)the missing packages and configuration of dataset path.
5)replace print with logger.info for better monitoring.
Which issue(s) this PR fixes:
Fixes #106