ComfyUI  >  Nodes  >  ComfyUI-Transformers >  ObjectDetection

ComfyUI Node: ObjectDetection

Class Name

ObjectDetectionPipeline

Category
ComputerVision/Transformers
Author
kadirnar (Account age: 2447 days)
Extension
ComfyUI-Transformers
Latest Updated
6/22/2024
Github Stars
0.0K

How to Install ComfyUI-Transformers

Install this extension via the ComfyUI Manager by searching for  ComfyUI-Transformers
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Transformers 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

ObjectDetection Description

Detect objects in images using pre-trained models, drawing bounding boxes with labels and confidence scores.

ObjectDetection:

The ObjectDetectionPipeline is a powerful tool designed to detect objects within an image using pre-trained object detection models. This node leverages advanced machine learning models to identify and locate various objects in an image, drawing bounding boxes around them and annotating them with labels and confidence scores. This functionality is particularly useful for tasks such as automated image analysis, surveillance, and content moderation, where identifying and categorizing objects within images is crucial. By utilizing this node, you can streamline the process of object detection, making it more efficient and accurate without needing extensive technical knowledge.

ObjectDetection Input Parameters:

image

The image parameter expects an input image in which objects need to be detected. This image should be in a format supported by the PIL library, such as JPEG or PNG. The quality and resolution of the image can impact the accuracy of the object detection results.

category_name

The category_name parameter is a string that specifies the category of objects you are interested in detecting within the image. This helps the model focus on relevant objects, improving detection accuracy for specific use cases.

model_name

The model_name parameter allows you to select from a list of pre-trained object detection models. The available options include "mattmdjaga/segformer_b2_clothes" and "nvidia/segformer-b1-finetuned-cityscapes-1024-1024". By default, the model "mattmdjaga/segformer_b2_clothes" is used. Choosing the appropriate model can significantly affect the detection performance based on the type of objects and the context of the image.

threshold

The threshold parameter is a float value that sets the confidence threshold for object detection. It determines the minimum confidence score required for an object to be considered detected. The default value is 0.5, meaning that only objects with a confidence score of 50% or higher will be detected and annotated. Adjusting this value can help filter out less certain detections, balancing between precision and recall.

ObjectDetection Output Parameters:

image

The image output parameter returns the input image with bounding boxes drawn around detected objects. Each bounding box is annotated with the label and confidence score of the detected object, providing a visual representation of the detection results. This output is useful for visual verification and further analysis of the detected objects.

ObjectDetection Usage Tips:

  • Ensure that the input image is of good quality and resolution to improve the accuracy of object detection.
  • Select the appropriate model based on the type of objects you expect to detect in your images. Different models are trained on different datasets and may perform better for specific categories.
  • Adjust the threshold parameter to fine-tune the balance between detecting more objects and reducing false positives. A higher threshold will result in fewer detections with higher confidence, while a lower threshold will increase the number of detections, including those with lower confidence.

ObjectDetection Common Errors and Solutions:

"Model not found"

  • Explanation: This error occurs when the specified model name is not available in the list of pre-trained models.
  • Solution: Ensure that the model_name parameter is set to one of the available options: "mattmdjaga/segformer_b2_clothes" or "nvidia/segformer-b1-finetuned-cityscapes-1024-1024".

"Image file not found"

  • Explanation: This error occurs when the specified image path does not exist or the file is not accessible.
  • Solution: Verify that the image path is correct and that the file is accessible. Ensure that the image file is in a supported format such as JPEG or PNG.

"Invalid threshold value"

  • Explanation: This error occurs when the threshold parameter is set to a value outside the valid range.
  • Solution: Ensure that the threshold parameter is set to a float value between 0 and 1. The default value is 0.5, which is a good starting point.

"Unsupported image format"

  • Explanation: This error occurs when the input image is in a format not supported by the PIL library.
  • Solution: Convert the image to a supported format such as JPEG or PNG before using it as input for the node.

ObjectDetection Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Transformers
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.