Plugin to easly test a yolo model and retrain it
Project description
Simple napari annotator
Minimal napari plugin for YOLO bbox detection + quick correction + retraining.
No dataset browser, no extra workflow logic. User provides the image in napari.
UI flow
- Path to model (
.pt) or model folder Load modelPredict- Optional destination folder for retrained model (browse or type)
- Edit boxes in napari shapes layer (
yolo_bboxes) Add correctionRetrain
Starting from scratch
The model input supports either:
- A
.ptmodel file, or - A folder path.
Folder behavior on Load model:
- If the folder already contains one or more
.ptfiles, the first one is loaded. - If the folder contains no
.ptfile, the plugin copies the bundledyolov8n.ptinto that folder and loads it. - Empty model input is invalid and will show an error.
If you do not have a model yet, start from a pretrained YOLOv8 nano checkpoint and use it as your initial file:
- Direct download: https://github.com/ultralytics/assets/releases/latest/download/yolov8n.pt
- Model overview: https://docs.ultralytics.com/models/yolov8/
After downloading, select that yolov8n.pt file in the Model field and continue with the correction/retrain loop.
Assumptions
- Input image is already RGB 8-bit (or compatible with clipping/conversion).
- Single class (
0: LABEL) for now. - Exactly one image layer should be present when using
Add correction.
Folder behavior
Given a model path like:
.../my_model/best.pt
The plugin uses .../my_model as root.
Add correction
Each click saves:
- Image to
my_model/corrections/<image_name>_<timestamp>.png - Labels to
my_model/corrections/<image_name>_<timestamp>.txt - Training config to
my_model/corrections/training_config.json(created/updated)
Image layer behavior:
- If no image layer exists,
Add correctionshows an error. - If more than one image layer exists,
Add correctionshows an error. - If exactly one image layer exists, that image layer is used for saving correction image data.
training_config.json defaults:
image_size: prefilled from the current image size usingmax(height, width)batch:8epochs:100patience:30
You can edit this file before clicking Retrain.
Label format is YOLO detection:
class x_center y_center width height
normalized to [0, 1].
Retrain
Each click creates:
<retrain_root>/dataset/images/train,images/vallabels/train,labels/valdataset.yaml
- Trains YOLO from those corrections
- Copies best model to:
<retrain_root>/best.pt
- Deletes training traces folder after extracting
best.pt
<retrain_root> resolution:
- If destination field is set, retraining outputs there.
- Otherwise it defaults to
my_model/retrained_<timestamp>.
So the retrained folder keeps a clean dataset + final model, without run artifacts.
Warning: Data labeled will be equally divided between traning and validation (50%).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_napari_cci_annotator-0.0.2.tar.gz.
File metadata
- Download URL: simple_napari_cci_annotator-0.0.2.tar.gz
- Upload date:
- Size: 6.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
309290e039127f7159b1afeac7720fdfaa33f2b9b19c330e2c001f64f70e9844
|
|
| MD5 |
7680e5a25155f1877ffd0940e49be104
|
|
| BLAKE2b-256 |
07ebd02a6e53e1520a4889b3799bbea2533cb4a05c79545fe6bb05d2c8cebfa0
|
Provenance
The following attestation bundles were made for simple_napari_cci_annotator-0.0.2.tar.gz:
Publisher:
test_and_deploy.yml on CCI-GU-Sweden/simple-napari-cci-annotator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_napari_cci_annotator-0.0.2.tar.gz -
Subject digest:
309290e039127f7159b1afeac7720fdfaa33f2b9b19c330e2c001f64f70e9844 - Sigstore transparency entry: 1144803836
- Sigstore integration time:
-
Permalink:
CCI-GU-Sweden/simple-napari-cci-annotator@bfc12dca0767c233544b6f3cf915b40e40461a85 -
Branch / Tag:
refs/tags/v0.0.7 - Owner: https://github.com/CCI-GU-Sweden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test_and_deploy.yml@bfc12dca0767c233544b6f3cf915b40e40461a85 -
Trigger Event:
push
-
Statement type:
File details
Details for the file simple_napari_cci_annotator-0.0.2-py3-none-any.whl.
File metadata
- Download URL: simple_napari_cci_annotator-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4555da51a674a1e4e991cc0b6b4c7404668e65694f277fdd978afdb3095e2e36
|
|
| MD5 |
bb5ca883919f464e9bcafd921da68129
|
|
| BLAKE2b-256 |
16b274e542bea4acbf4d319c8fe962a2dc13311e08646deaa4d6eef70a4033d7
|
Provenance
The following attestation bundles were made for simple_napari_cci_annotator-0.0.2-py3-none-any.whl:
Publisher:
test_and_deploy.yml on CCI-GU-Sweden/simple-napari-cci-annotator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_napari_cci_annotator-0.0.2-py3-none-any.whl -
Subject digest:
4555da51a674a1e4e991cc0b6b4c7404668e65694f277fdd978afdb3095e2e36 - Sigstore transparency entry: 1144803869
- Sigstore integration time:
-
Permalink:
CCI-GU-Sweden/simple-napari-cci-annotator@bfc12dca0767c233544b6f3cf915b40e40461a85 -
Branch / Tag:
refs/tags/v0.0.7 - Owner: https://github.com/CCI-GU-Sweden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test_and_deploy.yml@bfc12dca0767c233544b6f3cf915b40e40461a85 -
Trigger Event:
push
-
Statement type: