Skip to content

Commit 357aef7

Browse files
committedFeb 26, 2025
chore: updating recipes
1 parent 81e11fd commit 357aef7

File tree

2 files changed

+75
-74
lines changed

2 files changed

+75
-74
lines changed
 

‎README.md

+53-54
Original file line numberDiff line numberDiff line change
@@ -71,60 +71,59 @@ Recipes are available to run the pipelines. To see the available recipes, run t
7171
```shell
7272
just list
7373
```
74-
# Available Recipes
75-
| Recipe | Description |
76-
|---------------------------------|-------------|
77-
| list | List recipes |
78-
| install | Setup the environment |
79-
| cp-env | Copy the default .env file to the project |
80-
| update_trackers | Update the environment. Run after checking out code changes |
81-
| update-env | Update environment |
82-
| cp-core | Copy core dev code to the project on doris |
83-
| cp-dev-ptvr | Copy planktivore dev code to the project on doris |
84-
| cp-dev-uav | Copy UAV dev code to the project on doris |
85-
| cp-dev-bio | Copy bio dev code to the project on doris |
86-
| cp-dev-i2map | Copy i2map dev code to the project on doris |
87-
| plot-tsne-vss project='uav' | Generate a t-SNE plot of the VSS database |
88-
| optimize-vss project='uav' | Optimize the VSS database |
89-
| calc-acc-vss project='uav' | Calculate the accuracy of the VSS database |
90-
| reset-vss-all | Reset the VSS database, removing all data (caution!) |
91-
| reset-vss project='uav' | Reset the VSS database before initializing or creating it |
92-
| remove-vss project='uav' | Remove an entry from the VSS database |
93-
| init-vss project='uav' | Initialize the VSS database for a project |
94-
| load-vss project='uav' | Load computed exemplars into the VSS database |
95-
| load-cfe-isiis-videos | Load CFE ISIIS mission videos |
96-
| load-ptvr-images images='tmp/roi' | Load planktivore ROI images |
97-
| cluster-ptvr-images images='tmp/roi' | Cluster planktivore ROI images |
98-
| load-ptvr-clusters clusters='tmp/roi/cluster.csv' | Load planktivore ROI clusters |
99-
| cluster-uav | Cluster UAV mission data |
100-
| detect-uav | Detect UAV mission data |
101-
| detect-uav-test | Detect UAV mission data (test mode) |
102-
| load-uav-images | Load UAV mission images |
103-
| load-uav type="cluster" | Load UAV detections/clusters |
104-
| fix-uav-metadata | Fix UAV metadata (lat/lon/alt) |
105-
| compute-saliency project='uav' | Compute saliency for VOC data and update Trackers in Tator |
106-
| crop project='uav' | Crop detections from VOC formatted downloads |
107-
| download-crop project='uav' | Download and crop with defaults for a project |
108-
| download project='uav' | Download only |
109-
| predict-vss project='uav' | Predict images using the VSS database |
110-
| run-ctenoA-test | Run strided inference on a single video |
111-
| run-ctenoA-prod | Run strided inference on a collection of videos in a TSV file |
112-
| run-mega-inference | Run mega strided inference on a single video |
113-
| run-mega-track-bio-video | Run mega tracking on a single bio project video |
114-
| run-m | Run mega tracking on a single bio project video |
115-
| run-mega-track-bio-dive | Run mega tracking on an entire dive for the bio project |
116-
| run-mega-track-i2map-video | Run mega tracking on an i2MAP video |
117-
| run-mega-track-test-1min | Test mega tracking on a single video (1 min) |
118-
| run-mega-track-test-fastapiyv5 | Test mega tracking with FastAPI |
119-
| cluster-i2mapbulk | Run inference and cluster on i2MAP bulk data |
120-
| init-i2map-vss | Initialize VSS with combined i2MAP training data |
121-
| load-i2mapbulk data='data' | Load i2MAP bulk data |
122-
| download-i2mapbulk-unlabeled | Download unlabeled i2MAP bulk data |
123-
| gen-cfe-data | Generate training data for the CFE project |
124-
| gen-i2map-data | Generate training data for the i2MAP project |
125-
| gen-i2mapbulk-data | Generate training data for the i2MAP bulk server |
126-
| gen-uav-data | Generate training data for the UAV project |
127-
| gen-stats-csv project='UAV' | Generate training data stats |
74+
| Recipe | Description |
75+
|---------------------------------------------|-------------|
76+
| `list` | List recipes |
77+
| `install` | Setup the environment |
78+
| `cp-env` | Copy the default `.env` file to the project |
79+
| `update_trackers` | Update the environment after code changes |
80+
| `update-env` | Update environment |
81+
| `cp-core` | Copy core dev code to the project on Doris |
82+
| `cp-dev-ptvr` | Copy planktivore dev code to the project on Doris |
83+
| `cp-dev-uav` | Copy UAV dev code to the project on Doris |
84+
| `cp-dev-bio` | Copy bio dev code to the project on Doris |
85+
| `cp-dev-i2map` | Copy i2map dev code to the project on Doris |
86+
| `plot-tsne-vss project='uav'` | Generate a t-SNE plot of the VSS database |
87+
| `optimize-vss project='uav' *more_args=""` | Optimize the VSS database |
88+
| `calc-acc-vss project='uav'` | Calculate the accuracy of the VSS database |
89+
| `reset-vss-all` | Reset the VSS database (remove all data) |
90+
| `reset-vss project='uav'` | Reset the VSS database for a specific project |
91+
| `remove-vss project='uav' *more_args=""` | Remove an entry from the VSS database |
92+
| `init-vss project='uav' *more_args=""` | Initialize the VSS database for a project |
93+
| `load-vss project='uav'` | Load computed exemplars into the VSS database |
94+
| `load-cfe-isiis-videos *more_args=""` | Load CFE ISII mission videos |
95+
| `load-ptvr-images images='tmp/roi' *more_args=""` | Load planktivore ROI images |
96+
| `cluster-ptvr-images images='tmp/roi' *more_args=""` | Cluster planktivore ROI images |
97+
| `load-ptvr-clusters clusters='tmp/roi/cluster.csv' *more_args=""` | Load planktivore ROI clusters |
98+
| `rescale-ptvr-images` | Rescale planktivore ROI images |
99+
| `cluster-uav *more_args=""` | Cluster UAV missions |
100+
| `detect-uav *more_args=""` | Detect UAV missions |
101+
| `detect-uav-test` | Detect UAV mission data (test mode) |
102+
| `load-uav-images` | Load UAV mission images |
103+
| `load-uav type="cluster"` | Load UAV detections/clusters |
104+
| `fix-uav-metadata` | Fix UAV metadata (lat/lon/alt) |
105+
| `compute-saliency project='uav' *more_args=""` | Compute saliency for VOC data and update the Tator database |
106+
| `crop project='uav' *more_args=""` | Crop detections from VOC downloads |
107+
| `download-crop project='uav' *more_args=""` | Download and crop for a project |
108+
| `download project='uav'` | Download only |
109+
| `predict-vss project='uav' image_dir='/tmp/download' *more_args=""` | Predict images using the VSS database |
110+
| `run-ctenoA-test` | Run strided inference on a single video |
111+
| `run-ctenoA-prod` | Run strided inference on a collection of videos |
112+
| `run-mega-inference` | Run mega strided inference on a single video |
113+
| `run-mega-track-bio-video video='/mnt/M3/...' gpu_id='0'` | Run tracking on a bio project video |
114+
| `run-mega-track-bio-dive dive='/mnt/M3/...' gpu_id='0'` | Run tracking on an entire dive for the bio project |
115+
| `run-mega-track-i2map-video video='/mnt/M3/...' gpu_id='0'` | Run tracking on an i2map project video |
116+
| `run-mega-track-test-1min` | Test the tracking pipeline on a single video |
117+
| `run-mega-track-test-fastapiyv5` | Run tracking pipeline with FastAPI |
118+
| `cluster-i2mapbulk` | Run inference and cluster on i2MAP bulk data |
119+
| `cluster-ptvr-swp roi_dir='...' save_dir='...'` | Run sweep for planktivore data |
120+
| `load-i2mapbulk data='data'` | Load i2MAP bulk data |
121+
| `download-i2mapbulk-unlabeled` | Download unlabeled i2MAP bulk data |
122+
| `gen-cfe-data` | Generate training data for the CFE project |
123+
| `gen-i2map-data` | Generate training data for the i2map project |
124+
| `gen-i2mapbulk-data` | Generate i2map training data from the bulk server |
125+
| `gen-uav-data` | Generate training data for the UAV project |
126+
| `gen-stats-csv project='UAV' data='/mnt/.../'` | Generate training data statistics |
128127

129128
--
130129

‎justfile

+22-20
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ cp-dev-bio:
4949
cp ./aipipeline/projects/bio/core/*.py /Volumes/dcline/code/aipipeline/aipipeline/projects/bio/core
5050
cp ./aipipeline/projects/bio/config/* /Volumes/dcline/code/aipipeline/aipipeline/projects/bio/config/
5151
cp ./aipipeline/projects/bio/model/*.py /Volumes/dcline/code/aipipeline/aipipeline/projects/bio/model/
52+
cp ./deps/biotrack/biotrack/*.py /Volumes/dcline/code/aipipeline/deps/biotrack/biotrack/
5253

5354
# Copy i2map dev code to the project on doris
5455
cp-dev-i2map:
@@ -139,7 +140,7 @@ load-ptvr-images images='tmp/roi' *more_args="":
139140
cluster-ptvr-images images='tmp/roi' *more_args="":
140141
#!/usr/bin/env bash
141142
export PROJECT_DIR=./aipipeline/projects/planktivore
142-
time sdcat cluster roi --config-ini $PROJECT_DIR/config/sdcat.ini --roi-dir {{images}} {{more_args}}
143+
time sdcat cluster roi --config-ini $PROJECT_DIR/config/sdcat.ini --device cuda:1 --roi-dir {{images}} {{more_args}}
143144
# Load planktivore ROI clusters
144145
load-ptvr-clusters clusters='tmp/roi/cluster.csv' *more_args="":
145146
#!/usr/bin/env bash
@@ -252,7 +253,7 @@ predict-vss project='uav' image_dir='/tmp/download' *more_args="":
252253
run-ctenoA-test:
253254
#!/usr/bin/env bash
254255
export PYTHONPATH=.
255-
time conda run -n aipipeline --no-capture-output python3 aipipeline/projects/bio/vss_init.py \
256+
time conda run -n aipipeline --no-capture-output python3 aipipeline/projects/bio/run_strided_track.py \
256257
--config ./aipipeline/projects/bio/config/config.yml \
257258
--class_name "Ctenophora sp. A" \
258259
--endpoint-url "http://localhost:8001/predict" \
@@ -262,7 +263,7 @@ run-ctenoA-test:
262263
run-ctenoA-prod:
263264
#!/usr/bin/env bash
264265
export PYTHONPATH=.
265-
time conda run -n aipipeline --no-capture-output python3 aipipeline/projects/bio/vss_init.py \
266+
time conda run -n aipipeline --no-capture-output python3 aipipeline/projects/bio/cluster.py \
266267
--config ./aipipeline/projects/bio/config/config.yml \
267268
--class_name "Ctenophora sp. A" \
268269
--endpoint-url "http://fastap-fasta-0riu3xafmhua-337062127.us-west-2.elb.amazonaws.com/predict" \
@@ -272,7 +273,7 @@ run-ctenoA-prod:
272273
run-mega-inference:
273274
#!/usr/bin/env bash
274275
export PYTHONPATH=.
275-
time conda run -n aipipeline --no-capture-output python3 aipipeline/projects/bio/vss_init.py \
276+
time conda run -n aipipeline --no-capture-output python3 aipipeline/projects/bio/cluster.py \
276277
--config ./aipipeline/projects/bio/config/config.yml \
277278
--class_name "animal" \
278279
--class-remap "{\"animal\":\"marine organism\"}" \
@@ -293,8 +294,8 @@ run-mega-track-bio-video video='/mnt/M3/mezzanine/Ventana/2022/09/4432/V4432_202
293294
time conda run -n aipipeline --no-capture-output python3 aipipeline/projects/bio/process.py \
294295
--config ./aipipeline/projects/bio/config/config.yml \
295296
--max-frames-tracked 200 --min-score-det 0.1 --min-score-track 0.1 --batch-size 15 --min-frames 10 --version delme \
296-
--vits-model /Volumes/DeepSea-AI/models/i2MAP/mbari-i2map-vits-b-16ntnr-20250130/ \
297-
--det-model /Volumes/DeepSea-AI/models/megadet --skip-load \
297+
--vits-model /mnt/DeepSea-AI/models/i2MAP/mbari-i2map-vits-b-16ntnr-20250130/ \
298+
--det-model /mnt/DeepSea-AI/models/megadet --skip-load \
298299
--stride 1 --video {{video}} --max-seconds 10 --flush --gpu-id {{gpu_id}}
299300

300301
# Run the mega strided tracking pipeline on a single video for the bio project for 30 seconds
@@ -336,16 +337,17 @@ run-mega-track-bio-dive dive='/mnt/M3/mezzanine/Ventana/2022/09/4432' gpu_id='0'
336337
find "{{dive}}" -name '*.m*' ! -name "._*.m*" -type f | xargs -P 1 -n 1 -I {} bash -c 'process_file "{}"'
337338

338339
# Run the mega strided tracking pipeline on a single video for the i2map project
340+
# --det-model /mnt/DeepSea-AI/models/FathomNet/megalodon/ \
339341
#run-mega-track-i2map-video video='/mnt/M3/master/i2MAP/2019/02/20190204/i2MAP_20190205T102700Z_200m_F031_17.mov' gpu_id='0':
340342
run-mega-track-i2map-video video='/mnt/M3/master/i2MAP/2024/11/20241119/i2MAP_20241119T165914Z_200m_F031_4.mov' gpu_id='0':
341343
#!/usr/bin/env bash
342344
export PYTHONPATH=.:deps/biotrack:.
343345
time python3 aipipeline/projects/bio/process.py \
346+
--det-model /mnt/DeepSea-AI/models/megadetrg-yolov5 \
344347
--config ./aipipeline/projects/i2map/config/config.yml \
345-
--det-model /mnt/DeepSea-AI/models/FathomNet/megalodon/ \
346348
--vits-model /mnt/DeepSea-AI/models/i2MAP/mbari-i2map-vits-b-8-20250216\
347349
--max-frames-tracked 200 --min-score-det 0.02 --min-score-track 0.1 --min-frames 8 --version metadetrt-vits-track-ft \
348-
--stride 1 --skip-load --batch-size 16 --create-video \
350+
--stride 1 --skip-load --batch-size 16 --create-video --max-seconds 1 \
349351
--video {{video}} --gpu-id {{gpu_id}}
350352

351353
# Run the mega strided tracking pipeline on a single video to test the pipeline
@@ -354,8 +356,8 @@ run-mega-track-test-1min:
354356
export PYTHONPATH=.:/Users/dcline/Dropbox/code/biotrack:.
355357
time python3 aipipeline/projects/bio/predict.py \
356358
--config ./aipipeline/projects/bio/config/config.yml \
357-
--det-model /Volumes/DeepSea-AI/models/megadet \
358-
--vits-model /Volumes/DeepSea-AI/models/m3midwater-vit-b-16 \
359+
--det-model /mnt/DeepSea-AI/models/megadet \
360+
--vits-model /mnt/DeepSea-AI/models/m3midwater-vit-b-16 \
359361
--max-frames-tracked 200 --min-score-det 0.0002 --min-score-track 0.5 --min-frames 5 --version mega-vits-track-gcam \
360362
--stride 8 --max-seconds 60 --imshow --skip-load \
361363
--video aipipeline/projects/bio/data/V4361_20211006T163256Z_h265_1min.mp4
@@ -366,7 +368,7 @@ run-mega-track-test-fastapiyv5:
366368
export PYTHONPATH=.:/Users/dcline/Dropbox/code/biotrack:.
367369
time python3 aipipeline/projects/bio/predict.py \
368370
--config ./aipipeline/projects/bio/config/config.yml \
369-
--vits-model /Volumes/DeepSea-AI/models/m3midwater-vit-b-16 \
371+
--vits-model /mnt/DeepSea-AI/models/m3midwater-vit-b-16 \
370372
--max-frames-tracked 200 --min-score-det 0.0002 --min-score-track 0.5 --min-frames 5 --version mega-vits-track-gcam \
371373
--stride 15 --max-seconds 60 --imshow --skip-load \
372374
--endpoint-url http://FastAP-FastA-0RIu3xAfMhUa-337062127.us-west-2.elb.amazonaws.com/predict \
@@ -377,19 +379,19 @@ cluster-i2mapbulk:
377379
#!/usr/bin/env bash
378380
export PYTHONPATH=.
379381
export MPLCONFIGDIR=/tmp
380-
time conda run -n aipipeline --no-capture-output python3 aipipeline/projects/i2mapbulk/vss_init.py \
382+
time conda run -n aipipeline --no-capture-output python3 aipipeline/prediction/cluster_pipeline.py \
381383
--config ./aipipeline/projects/i2mapbulk/config/config_unknown.yml \
382384
--data aipipeline/projects/i2mapbulk/data/bydepth.txt
383385

384-
# Init VSS with combined i2MAP training data. Run with just init-i2map-vss
385-
init-i2map-vss:
386+
# Run sweep for planktivore data. Example just cluster-ptvr-swp /mnt/ML_SCRATCH/Planktivore/aidata-export-03-low-mag-square /mnt/DeepSea-AI/data/Planktivore/cluster/aidata-export-03-low-mag-square
387+
cluster-ptvt-sweep roi_dir='/mnt/ML_SCRATCH/Planktivore/aidata-export-03-low-mag-square' save_dir='/mnt/DeepSea-AI/data/Planktivore/cluster/aidata-export-03-low-mag-square':
386388
#!/usr/bin/env bash
387389
export PYTHONPATH=.
388-
export MPLCONFIGDIR=/tmp
389-
time conda run -n aipipeline --no-capture-output python3 aipipeline/projects/i2map/vss_init.py \
390-
--config ./aipipeline/projects/i2map/config/config.yml \
391-
--processed-path /mnt/ML_SCRATCH/i2map/Combined/
392-
390+
for alpha in 0.8 0.9 1.0; do
391+
for epsilon in 0.01 0.05 0.1 0.5; do
392+
just --justfile {{justfile()}} cluster-ptvr-images {{roi_dir}} --save-dir {{save_dir}} --alpha $alpha --cluster-selection-epsilon $epsilon
393+
done
394+
done
393395
# Load i2MAP bulk data run with ENV_FILE=.env.i2map just load-i2mapbulk <path to the cluster_detections.csv file>
394396
load-i2mapbulk data='data':
395397
#!/usr/bin/env bash
@@ -421,4 +423,4 @@ gen-uav-data:
421423
gen-stats-csv project='UAV' data='/mnt/ML_SCRATCH/UAV/':
422424
#!/usr/bin/env bash
423425
export PYTHONPATH=.
424-
time conda run -n aipipeline python3 aipipeline/prediction/gen_stats.py --data {{data}} --prefix {{project}}
426+
time conda run -n aipipeline python3 aipipeline/prediction/gen_stats.py --data {{data}} --prefix {{project}}

0 commit comments

Comments
 (0)