Skip to content

Conversation

wtomin
Copy link
Collaborator

@wtomin wtomin commented Oct 13, 2025

  • SAM2 & Language SAM

    • remove todos no longer in plan;
    • update ms version to 2.7.0;
  • Llada

    • Remove its inference code because it will be no longer maintained in the master branch.

Copy link
Contributor

Summary of Changes

Hello @wtomin, 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 streamlines the examples section by updating critical dependency information for SAM2 and LanguageSAM to MindSpore 2.7.0 and CANN 8.1.RC1, ensuring users have the most current setup instructions. A major part of this update involves the deprecation and complete removal of the Llada example, simplifying the repository's structure. Minor code adjustments were also made to enhance the reliability and user experience of the SAM2 examples.

Highlights

  • Dependency Updates: The README.md and README_CN.md files for both SAM2 and LanguageSAM examples have been updated to reflect support for MindSpore 2.7.0 and newer versions of Ascend Driver, Firmware, and CANN toolkit/kernel (8.1.RC1).
  • Llada Example Removal: The entire llada example, including its documentation (README.md), inference scripts (chat.py, generate.py), and model definition files, has been removed from the repository. This indicates that the Llada example will no longer be maintained in the master branch.
  • SAM2 Readme and Script Improvements: The SAM2 README.md and README_CN.md files have been cleaned up by removing outdated TODO sections. Additionally, the predict_image.py script received a minor fix to ensure input_point is correctly formatted as a NumPy array, and example commands in the README were updated for clarity.
  • Code Robustness Fix: A small but important fix was applied in examples/sam2/sam2/modeling/sam/prompt_encoder.py to explicitly specify the dtype argument when calling mint.empty, improving code robustness and preventing potential issues with default type inference.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 provides valuable maintenance updates. It correctly updates the MindSpore and CANN versions for the SAM2 and LanguageSAM examples, ensuring they stay current. The removal of the llada example is a good cleanup step for code that is no longer maintained. Additionally, the pull request includes several beneficial fixes, such as correcting typos in documentation, improving command-line instructions, and fixing bugs in the SAM2 prediction script and model implementation. Overall, these changes enhance the repository's quality and maintainability.

"images/groceries.jpg",
], "Please provide x and y coordinates for the point"
input_point = [500, 375] if args.image_path == "images/truck.jpg" else [600, 250]
input_point = np.array([input_point])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The predict method expects an Nx2 numpy array for point coordinates. The previous code provided a Python list, which would have been converted to an incorrect shape. This change correctly converts the point to a (1, 2) numpy array, aligning with the expected input format and fixing a potential runtime error.

"""
bs = self._get_batch_size(points, boxes, masks)
sparse_embeddings = mint.empty((bs, 0, self.embed_dim), ms.float32)
sparse_embeddings = mint.empty((bs, 0, self.embed_dim), dtype=ms.float32)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using the keyword argument dtype for mint.empty is the correct approach, as it's a keyword-only argument. The previous implementation using a positional argument was incorrect and would likely cause a TypeError. This is a great fix for correctness and robustness.

@wtomin wtomin requested a review from vigo999 October 13, 2025 08:19
@wtomin wtomin added documentation Improvements or additions to documentation ms version update model update with new mindspore version or cann version labels Oct 13, 2025
@vigo999 vigo999 added this to mindone Oct 17, 2025
@vigo999 vigo999 moved this to In Progress in mindone Oct 17, 2025
@vigo999 vigo999 merged commit 86e88c0 into mindspore-lab:master Oct 18, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in mindone Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation ms version update model update with new mindspore version or cann version

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants