ComfyUI > Nodes > Comfyui-Yolov8-JSON > Draw Labelme Json

ComfyUI Node: Draw Labelme Json

Class Name

Draw Labelme Json

Category
Comfyui-Yolov8-JSON
Author
prodogape (Account age: 1314days)
Extension
Comfyui-Yolov8-JSON
Latest Updated
2024-08-28
Github Stars
0.02K

How to Install Comfyui-Yolov8-JSON

Install this extension via the ComfyUI Manager by searching for Comfyui-Yolov8-JSON
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Comfyui-Yolov8-JSON 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Draw Labelme Json Description

Facilitates visualization of annotations on images using Labelme JSON format for AI artists and developers.

Draw Labelme Json:

The Draw Labelme Json node is designed to facilitate the visualization of annotations on images using the Labelme JSON format. This node is particularly useful for AI artists and developers who work with annotated datasets, as it allows for the easy rendering of labeled regions directly onto images. By leveraging this node, you can visually inspect and verify the accuracy of annotations, ensuring that the labeled data aligns with the intended objects or regions within an image. The node processes JSON data that contains information about shapes, labels, and coordinates, and it draws these annotations onto the image using specified colors and fonts. This functionality is essential for tasks that require precise visual representation of labeled data, such as training machine learning models or creating datasets for computer vision applications.

Draw Labelme Json Input Parameters:

image_pil

This parameter represents the input image in the PIL (Python Imaging Library) format. It is the canvas on which the annotations will be drawn. The image should be in RGB format to ensure compatibility with the drawing functions.

labelme_json

This parameter contains the JSON data in the Labelme format, which includes information about the shapes, labels, and coordinates of the annotations. It is crucial for defining what and where to draw on the image.

show_prompt

This parameter determines which labels should be displayed on the image. If set to "all," all labels will be shown. Otherwise, it can be a comma-separated list of specific labels to display.

event_prompt

This parameter specifies which labels should be highlighted as events. Labels matching this prompt will be drawn with a distinct color (red) to differentiate them from non-event labels.

prompt_name

This parameter is used to map existing labels to new labels based on a JSON string. It allows for dynamic renaming of labels before they are drawn on the image.

show_threshold

This parameter indicates whether to display the threshold value associated with each label. If set to "yes," the threshold will be appended to the label text.

Draw Labelme Json Output Parameters:

image_tensor_out

This output is the processed image with annotations drawn on it, converted back into a tensor format suitable for further processing or saving.

json_data

This output provides the modified JSON data, which includes any changes made to the labels or shapes during the drawing process. It is useful for saving or further analysis.

res_mask

This output consists of masks corresponding to the annotated regions in the image. Each mask is a binary representation of the area covered by a particular annotation, useful for tasks like segmentation.

Draw Labelme Json Usage Tips:

  • Ensure that the input image is in RGB format to avoid any color-related issues during the drawing process.
  • Use the show_prompt and event_prompt parameters to control which labels are visible and highlighted, allowing for focused analysis of specific annotations.
  • Utilize the prompt_name parameter to dynamically rename labels, which can be helpful when working with datasets that require consistent labeling conventions.

Draw Labelme Json Common Errors and Solutions:

JSONDecodeError

  • Explanation: This error occurs when the JSON string provided in labelme_json or prompt_name is not properly formatted.
  • Solution: Verify that the JSON string is correctly formatted and valid. Use a JSON validator tool to check for syntax errors.

Mismatched Image and JSON Length

  • Explanation: This error arises when the number of images does not match the number of JSON annotations provided.
  • Solution: Ensure that each image has a corresponding JSON annotation. Check the lengths of the image and JSON lists to confirm they match.

Font File Not Found

  • Explanation: This error occurs if the specified font file for drawing text is missing.
  • Solution: Ensure that the font file PingFangRegular.ttf is located in the correct directory as specified in the code. If necessary, update the path to point to an existing font file.

Draw Labelme Json Related Nodes

Go back to the extension to check out more related nodes.
Comfyui-Yolov8-JSON
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Draw Labelme Json