ComfyUI  >  Nodes  >  comfyui-ultralytics-yolo >  Detect By Label

ComfyUI Node: Detect By Label

Class Name

DetectByLabel

Category
♾️Mixlab/Mask
Author
shadowcz007 (Account age: 3428 days)
Extension
comfyui-ultralytics-yolo
Latest Updated
6/22/2024
Github Stars
0.0K

How to Install comfyui-ultralytics-yolo

Install this extension via the ComfyUI Manager by searching for  comfyui-ultralytics-yolo
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter comfyui-ultralytics-yolo in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Detect By Label Description

Identify and isolate objects in images based on labels using YOLO object detection models.

Detect By Label:

The DetectByLabel node is designed to identify and isolate specific objects within an image based on their labels using the YOLO (You Only Look Once) object detection models. This node allows you to specify target labels, and it will filter the detected objects to include only those that match the specified labels. This is particularly useful for tasks where you need to focus on certain objects within an image, such as detecting specific animals, vehicles, or other predefined categories. By leveraging the power of YOLO models, DetectByLabel provides a robust and efficient way to perform object detection with high accuracy and speed, making it an essential tool for AI artists working on projects that require precise object identification and segmentation.

Detect By Label Input Parameters:

image

This parameter represents the input image on which object detection will be performed. The image should be in a format compatible with the YOLO model, typically a tensor representation of the image.

confidence

This parameter sets the confidence threshold for object detection. Only objects detected with a confidence score equal to or higher than this threshold will be considered. The value ranges from 0.0 to 1.0, with a default value of 0.1. Adjusting this value can help filter out less certain detections, improving the accuracy of the results.

model

This parameter specifies the YOLO model to be used for object detection. The model should be a .pt file located in the specified directory. The choice of model can significantly impact the detection performance and accuracy, so selecting an appropriate model for your task is crucial.

type

This parameter determines the type of YOLO model to be used. The available options are "YOLO-World" and "YOLOv8". Each type corresponds to different versions or configurations of the YOLO model, which may vary in terms of performance and capabilities.

target_label

This optional parameter allows you to specify the labels of the objects you want to detect. It should be a comma-separated string of labels. Only objects matching these labels will be included in the output. This is useful for focusing on specific categories of objects within an image.

debug

This optional parameter enables or disables debug mode. When set to "on", additional debug information will be printed, which can be helpful for troubleshooting and understanding the detection process. The available options are "on" and "off".

Detect By Label Output Parameters:

masks

This output parameter provides the masks for the detected objects. Each mask is a binary image where the detected object is highlighted. These masks can be used for further image processing tasks such as segmentation or overlaying on the original image.

labels

This output parameter returns the labels of the detected objects. These labels correspond to the categories specified in the target_label parameter and provide a textual representation of the detected objects.

grids

This output parameter contains the bounding boxes for the detected objects. Each bounding box is represented by a tuple of coordinates (x, y, width, height) that define the location and size of the detected object within the image.

image

This output parameter returns the original input image with the detected objects highlighted. This can be useful for visualizing the results of the object detection process and verifying the accuracy of the detections.

Detect By Label Usage Tips:

  • Ensure that the input image is preprocessed correctly and is in a format compatible with the YOLO model to achieve the best detection results.
  • Adjust the confidence parameter to filter out less certain detections, which can help improve the accuracy of the results.
  • Use the target_label parameter to focus on specific objects within the image, which can be particularly useful for tasks that require detecting only certain categories of objects.
  • Enable the debug mode if you encounter issues or need to understand the detection process better, as it provides additional information that can be helpful for troubleshooting.

Detect By Label Common Errors and Solutions:

"Model file not found"

  • Explanation: The specified YOLO model file could not be located in the directory.
  • Solution: Ensure that the model file is correctly named and located in the specified directory. Verify the path and file extension.

"Invalid confidence value"

  • Explanation: The confidence value provided is outside the acceptable range (0.0 to 1.0).
  • Solution: Adjust the confidence value to be within the range of 0.0 to 1.0.

"No objects detected"

  • Explanation: No objects were detected in the image that meet the specified confidence threshold and target labels.
  • Solution: Lower the confidence threshold or verify that the target labels are correctly specified and match the labels used by the YOLO model.

"Debug information not available"

  • Explanation: Debug mode is not enabled, so no additional debug information is printed.
  • Solution: Set the debug parameter to "on" to enable debug mode and obtain additional information for troubleshooting.

Detect By Label Related Nodes

Go back to the extension to check out more related nodes.
comfyui-ultralytics-yolo
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.