Skip to content
Snippets Groups Projects
README.md 2.92 KiB
Newer Older
# TRIA: TRIchogrammA parasitized egg count.

## Description
TRIA (TRIchogrammA parasitized egg count) is an ultralytics model that identificate eggs of _Ephestia kuehnniella_ previously parasitized by _Trichogramma_ wasps. TRIA was initialized on YOLO11 and trained on a specific datasets.

## Installation
- You need [ultralytics](https://docs.ultralytics.com/fr#where-to-start). Note that for ultralytics, you should have Anaconda or Miniconda installed on your system. If not, download and install it from [Anaconda](https://www.anaconda.com/) or [Miniconda](https://docs.anaconda.com/miniconda/). Then, you can install the Ultralytics package using pip. Here's a basic installation command (in a terminal):

`pip install ultralytics`

- You need to download the trained model "tria-v1.pt".

Just call the model on the pictures you want to annotate (let imagine that the pictures are in the folder "pictures2count") with the following command (in a terminal, in the same folder where "tria-v1.pt" was saved):
`yolo predict model=tria-v1.pt source=pictures2count/ save_txt=True conf=0.5`
The model will create a folder "runs/detect/predict" with the annotated images and a folder "runs/detect/predict/labels/" with all the annotation in ".txt" format.
<details><summary>If you are not satisfied with the predictions</summary>
If predictions are not perfect, modifications can be made using [Yolo_Label](https://github.com/developer0hye/Yolo_Label):
In order to use [Yolo_Label](https://github.com/developer0hye/Yolo_Label), you will need the pictures in the ".jpg" format. If the pictures are not initially in ".jpg" (let imagine that the pictures are in ".tif"), you might convert the pictures with [FFmpeg](https://www.ffmpeg.org/), by tapping the following in a terminal in the "pictures2count" folder:

`for i in *.tif; do ffmpeg -i "$i" "${i%.*}.jpg"; done`
When pictures are in ".jpg" format, paste the predicted annotations "runs/detect/predict/labels/" in the folder, paste a "names.txt" file with a single letter (e.g. "p") inside, and open [Yolo_Label](https://github.com/developer0hye/Yolo_Label) in this specific folder. You will be able to correct manually the predictions.
### Low density
| Initial image | Predictions |
| :-----------: | :---------: |
| <img src="example/example_init_low.jpg"/>  | <img src="example/example_predict_low.jpg"/> |
### High density

| Initial image | Predictions |
| :-----------: | :---------: | 
| <img src="example/example_init_high.jpg"/> | <img src="example/example_predict_high.jpg"/> |
This model only works for images with size and definition similar to the example.

## Authors and acknowledgment
- C. BRESCH (INRAE) annotated the images.
- L. VAN OUDENHOVE (INRAE) led the project. 
- Thanks to J. DE GOËR and L. PETITCOLIN for advices.
- The CoLab.Ia platform provided the GPU for training.
## Contact
louise.vanoudenhove@inrae.fr
## License
GNU GENERAL PUBLIC LICENSE, v3.