Image Segmentation
ultralytics
ultralytics-yolov11-seg
yolo
yolo11
segmentation
instance-segmentation
Instructions to use dashingzombie/yolov11-segmentation_earth-worm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use dashingzombie/yolov11-segmentation_earth-worm with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("dashingzombie/yolov11-segmentation_earth-worm", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Download inference.py from dashingzombie/yolov11-segmentation_earth-worm: direct link, hf CLI and curl.
- Browser
- Download file 788 Bytes
-
https://huggingface.co/dashingzombie/yolov11-segmentation_earth-worm/resolve/main/inference.py
- Command line
-
hf download hf://dashingzombie/yolov11-segmentation_earth-worm/inference.py
-
curl -L -o inference.py https://huggingface.co/dashingzombie/yolov11-segmentation_earth-worm/resolve/main/inference.py
788 Bytes
| import os | |
| from ultralytics import YOLO | |
| import glob | |
| # Load your trained segmentation model | |
| model = YOLO('runs/segment/train/weights/last.pt') | |
| IN_DIR = "/home/quentin/repos/yolov11-segmentation_earth-worm/data/yolo_split/images/val" | |
| # Predict on an image, replace with your image path or URL | |
| files = sorted(glob.glob(f"{IN_DIR}/*.jpg")) | |
| for f in files: | |
| results = model(f) | |
| # Save results, this includes saving masks | |
| os.makedirs("results/", exist_ok=True) | |
| results[0].save(f"results/result_{os.path.basename(f)}") | |
| # | |
| # for f in sorted(glob.glob(f"{IN_DIR}/2024-10-08/*.jpg")): | |
| # results = model(f) | |
| # # Save results, this includes saving masks | |
| # os.makedirs("results/2024-10-08", exist_ok=True) | |
| # results[0].save(f"results/2024-10-08/result_{os.path.basename(f)}") |