infer_yolo_world

infer_yolo_world

About

1.0.1
GPL-3.0

YOLO-World is a real-time zero-shot object detection modelthat leverages the power of open-vocabulary learning to recognize and localize a wide range of objects in images.

Task: Object detection
YOLO
zero-shot
mmdet
mmlab
mmyolo
Tencent AI
PyTorch

YOLO-World is a state-of-the-art real-time object detection model that leverages the power of open-vocabulary learning to recognize and localize a wide range of objects in images.

illustration1

illustration

🚀 Use with Ikomia API

1. Install Ikomia API

We strongly recommend using a virtual environment. If you're not sure where to start, we offer a tutorial here.

pip install ikomia

2. Create your workflow

from ikomia.dataprocess.workflow import Workflow
from ikomia.utils.displayIO import display

# Init your workflow
wf = Workflow()

# Add algorithm
algo = wf.add_task(name="infer_yolo_world", auto_connect=True)

# Run on your image
wf.run_on(url="https://images.pexels.com/photos/745045/pexels-photo-745045.jpeg?cs=srgb&dl=pexels-helena-lopes-745045.jpg&fm=jpg&w=1280&h=869")

# Display your image
display(algo.get_image_with_graphics())

☀️ Use with Ikomia Studio

Ikomia Studio offers a friendly UI with the same features as the API.

  • If you haven't started using Ikomia Studio yet, download and install it from this page.
  • For additional guidance on getting started with Ikomia Studio, check out this blog post.

📝 Set algorithm parameters

  • model_name (str) - default 'yolo_world_m': Name of the YOLO_WORLD pre-trained model. Other model available:
    • yolo_world_s
    • yolo_world_v2_s
    • yolo_world_m
    • yolo_world_v2_m
    • yolo_world_l
    • yolo_world_v2_l
    • yolo_world_l_plus
    • yolo_world_v2_l_plus
    • yolo_world_l_x
    • yolo_world_v2_l_x
  • conf_thres (float) default '0.1': Box threshold for the prediction [0,1].
  • iou_thres (float) - default '0.25': Intersection over Union, degree of overlap between two boxes [0,1].
  • max_dets (int) - default '100': The maximum number of bounding boxes that can be retained across all classes after NMS (Non-Maximum Suppression). This parameter limits the total number of detections returned by the model, ensuring that only the most confident detections are retained.
  • cuda (bool): If True, CUDA-based inference (GPU). If False, run on CPU. If using a custom model:
  • model_weight_file (str, optional): Path to model weights file .pth.
  • config_file (str, optional): Path to model config file .py.

Parameters should be in strings format when added to the dictionary.

from ikomia.dataprocess.workflow import Workflow
from ikomia.utils.displayIO import display

# Init your workflow
wf = Workflow()

# Add algorithm
algo = wf.add_task(name="infer_yolo_world", auto_connect=True)

algo.set_parameters({
"model_name": "yolo_world_m",
"prompt": "person, dog, cup",
"max_dets": "100",
"conf_thres": "0.07"
})

# Run on your image
wf.run_on(url="https://images.pexels.com/photos/745045/pexels-photo-745045.jpeg?cs=srgb&dl=pexels-helena-lopes-745045.jpg&fm=jpg&w=1280&h=869")

# Display your image
display(algo.get_image_with_graphics())

🔍 Explore algorithm outputs

Every algorithm produces specific outputs, yet they can be explored them the same way using the Ikomia API. For a more in-depth understanding of managing algorithm outputs, please refer to the documentation.

from ikomia.dataprocess.workflow import Workflow

# Init your workflow
wf = Workflow()

# Add algorithm
algo = wf.add_task(name="infer_yolo_world", auto_connect=True)

# Run on your image
wf.run_on(url="https://images.pexels.com/photos/745045/pexels-photo-745045.jpeg?cs=srgb&dl=pexels-helena-lopes-745045.jpg&fm=jpg&w=1280&h=869")

# Iterate over outputs
for output in algo.get_outputs():
# Print information
print(output)
# Export it to JSON
output.to_json()

Developer

  • Ikomia
    Ikomia

License

GNU General Public License v3.0
Read license full text

Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights.

PermissionsConditionsLimitations

Commercial use

License and copyright notice

Liability

Modification

State changes

Warranty

Distribution

Disclose source

Patent use

Same license

Private use

This is not legal advice: this description is for informational purposes only and does not constitute the license itself. Provided by choosealicense.com.