ML workflow to detect NOW on sticky traps using scinet and yolo.
python3 -m venv venv_yolo
source venv_yolo/bin/activate
pip install -r requirements.txtpip install ipykernel
python -m ipykernel install --user --name=venv_yolo --display-name "YOLO (venv_yolo)"train: path/to/train/images
val: path/to/val/images
names:
- class1
- class2from ultralytics import YOLO
model = YOLO("yolov8n.pt")
model.train(
data="your_data.yaml",
epochs=25,
imgsz=640,
batch=8,
project="my_project",
name="my_experiment"
)organise.py: Arranges dataset into folders for traningrotate.py: Rotates imagesfix.py: Fixes broken annotations or pathsformat_and_separate.py: Moves and formats files by typeduplicate.py: Detects and filters out duplicate filesvoc.py: Converts annotations to/from Pascal VOC formatrm-file.txt: List of files to delete from dataset not needed for most applications
train.py: Main training runnertrain_now_6_25_2025.py: Specific experiment training scriptmodelTest.py: Runs predictions and outputs images with bounding boxesmodel_analytics_demo.py: Loads trained model and shows visual metricsmodel_analytics_function.py: Helper functions for plotting precision, recall, confidence, and losscompare_model.py:Graphs confidence scores for 2 modelscount-export.pyput in folder to script and get out NOW counts csv
demo.py: Fast sample inference runneraccurate.py: Compares predictions against ground truthbet.py: May experiment with detection thresholds or model output settingscount.py: Tallies number of detections per image or set
data-template.yml: Template YOLO data configjob.sh: SLURM shell script to run training on a cluster not needed for mostmake-venv: Bash script to set up Python virtual environmentsetup.txt: Extra setup notes and instructions