About
Generalized-scale instance segmentation with GECO2 from bbox exemplars.
GECO2 exemplar-based instance segmentation inference for object counting scenarios.
The algorithm takes one or multiple example bounding boxes (prompts) and predicts object instances as:
- bounding boxes
- confidence scores
- binary masks (one per instance)

🚀 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 Workflowfrom ikomia.utils.displayIO import displaywf = Workflow()algo = wf.add_task(name="infer_geco2", auto_connect=True)algo.set_parameters({"input_box": "[197.4,21.0,225.3,36.91]"})wf.run_on(url="https://raw.githubusercontent.com/jerpelhan/GeCo/refs/heads/main/material/1.jpg")display(algo.get_image_with_mask_and_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.
Prompts can be provided in two ways:
- draw one or more rectangles in Studio (graphics input)
- set
input_boxin parameters
📝 Set algorithm parameters
Parameters:
model_name: model variant (GECO2FSCDorCNTQG_multitrain_ca44).cuda: enable CUDA if available (True/False).confidence_threshold: confidence threshold in[0,1].input_box: prompt box(es) in JSON:- single box:
[x1, y1, x2, y2] - multiple boxes:
[[x1, y1, x2, y2], [x1, y1, x2, y2], ...]
- single box:
from ikomia.dataprocess.workflow import Workflowfrom ikomia.utils.displayIO import displaywf = Workflow()algo = wf.add_task(name="infer_geco2", auto_connect=True)algo.set_parameters({"model_name": "GECO2FSCD","cuda": "True","confidence_threshold": "0.30","input_box": "[[197.4,21.0,225.3,36.91], [166.1, 147.2, 177.1, 172.1]]"})wf.run_on(url="https://raw.githubusercontent.com/jerpelhan/GeCo/refs/heads/main/material/1.jpg")display(algo.get_image_with_mask_and_graphics())
🔍 Explore algorithm outputs
for output in algo.get_outputs():print(output)print(output.to_json())
Developer
Ikomia
License
MIT License
A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.
| Permissions | Conditions | Limitations |
|---|---|---|
Commercial use | License and copyright notice | Liability |
Modification | Warranty | |
Distribution | ||
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.