SAM3 Point Collector:
The SAM3PointCollector is an interactive node designed to facilitate the collection of user-defined points on an image canvas for use in segmentation tasks. This node allows you to intuitively select positive and negative points directly on an image, which are then normalized and prepared for further processing in segmentation models like SAM3Segmentation. By providing a visual interface, it simplifies the process of point selection, making it accessible even to those without a technical background. The node's primary goal is to streamline the input of spatial data, ensuring that the points are accurately captured and formatted for subsequent analysis. This functionality is particularly beneficial for AI artists and designers who need to define regions of interest within an image for segmentation purposes, offering a straightforward method to influence the segmentation outcome by specifying areas of importance or exclusion.
SAM3 Point Collector Input Parameters:
image
The image parameter is the visual canvas on which you will interact to select points. It serves as the backdrop for point selection, allowing you to visually identify and mark areas of interest. The image is displayed in an interactive canvas where left-clicking adds positive points (indicated by green circles), and Shift+Left-click or Right-click adds negative points (indicated by red circles). This parameter does not have a minimum or maximum value but is essential for the node's operation as it provides the context for point selection.
points_store
The points_store parameter is a string that acts as a storage mechanism for the points you select. It is not directly interacted with during the point selection process but is used internally to manage and cache the points data. The default value is an empty JSON object ({}), and it is crucial for maintaining the state of the points between interactions.
coordinates
The coordinates parameter is a string that contains the JSON-encoded list of positive point coordinates. These coordinates are parsed and normalized based on the image dimensions to ensure they are in the correct format for further processing. The default value is an empty list ([]), and it is vital for capturing the specific locations of positive points on the image.
neg_coordinates
The neg_coordinates parameter is similar to coordinates but specifically for negative points. It holds the JSON-encoded list of negative point coordinates, which are also normalized to fit the image dimensions. The default value is an empty list ([]), and it plays a key role in defining areas that should be excluded or treated differently in the segmentation process.
SAM3 Point Collector Output Parameters:
positive_points
The positive_points output parameter provides an array of normalized coordinates and labels for the positive points selected on the image. Each point is represented by its normalized x and y coordinates, along with a label indicating its positive status. This output is crucial for segmentation tasks as it defines the areas of interest that the segmentation model should focus on.
negative_points
The negative_points output parameter offers an array of normalized coordinates and labels for the negative points. Similar to positive_points, each point includes its normalized coordinates and a label, but in this case, the label indicates a negative status. This output is essential for guiding the segmentation model to avoid or treat these areas differently, ensuring a more accurate and tailored segmentation result.
SAM3 Point Collector Usage Tips:
- Ensure that the image you use is clear and well-defined to make point selection easier and more accurate.
- Use a combination of positive and negative points to effectively guide the segmentation model, providing a balanced input that highlights areas of interest and exclusion.
- Regularly save your point selections using the
points_storeto avoid losing data during the interactive process.
SAM3 Point Collector Common Errors and Solutions:
JSONDecodeError
- Explanation: This error occurs when the
coordinatesorneg_coordinatesstrings are not properly formatted as JSON. - Solution: Ensure that the input strings for
coordinatesandneg_coordinatesare valid JSON. Use a JSON validator to check the format before inputting them into the node.
Image Dimension Mismatch
- Explanation: This error can happen if the image dimensions do not match the expected format, leading to issues in point normalization.
- Solution: Verify that the image is correctly loaded and that its dimensions are as expected. Ensure the image is not corrupted and is in a supported format.
