No description
  • Rust 48.3%
  • Kotlin 24.1%
  • Typst 14.3%
  • Python 10.5%
  • Nix 2.8%
Find a file
2026-05-14 20:48:51 +02:00
app wip 2026-05-11 11:25:54 +02:00
gradle wip 2026-04-30 12:19:04 +02:00
model-python Merge branch 'master' into data-augmentation 2026-05-13 22:50:09 +02:00
model-rs wip 2026-05-14 20:29:09 +02:00
poster wip 2026-05-14 20:47:06 +02:00
.envrc init 2026-03-06 21:07:40 +01:00
.gitattributes model (#3) 2026-03-24 23:29:01 +01:00
.gitignore wip 2026-04-30 12:19:04 +02:00
build.gradle.kts wip 2026-03-08 23:11:28 +01:00
Cargo.lock wip 2026-05-12 09:49:49 +02:00
Cargo.toml model-rs (#5) 2026-04-03 00:02:23 +02:00
flake.lock model-rs (#5) 2026-04-03 00:02:23 +02:00
flake.nix wip 2026-05-11 13:26:03 +02:00
gradle.properties wip 2026-03-08 23:11:28 +01:00
gradlew wip 2026-03-08 23:11:28 +01:00
gradlew.bat wip 2026-03-08 23:11:28 +01:00
local.properties wip 2026-03-08 23:11:28 +01:00
logs.md Merge branch 'master' into data-augmentation 2026-05-13 22:50:09 +02:00
README.md wip 2026-05-14 20:48:20 +02:00
requirements.txt wip 2026-05-12 09:49:49 +02:00
settings.gradle.kts wip 2026-03-08 23:11:28 +01:00

/!\ Validation is broken in model-rs.

Train

The whole repo uses https://www.kaggle.com/datasets/ronanpickell/b100-lego-detection-dataset.

To train, after unzipping the dataset, these are the commands ran:

Run pip install -r requirements.txt

model-python:

LIBTORCH=~/.local/lib/python3.11/site-packages/torch LIBTORCH_USE_PYTORCH=1 LD_LIBRARY_PATH=~/.local/lib/python3.11/site-packages/torch/lib LD_PRELOAD=~/.local/lib/python3.11/site-packages/torch/lib/libtorch_cuda.so python model-python/main.py train --data-path data/b200c-detection/ --epochs 40 --batch-size 50 --lr 1e-3 --no-pre-trained-weights

model-rs:

RUST_BACKTRACE=1 LIBTORCH=~/.local/lib/python3.11/site-packages/torch LIBTORCH_USE_PYTORCH=1 LD_LIBRARY_PATH=~/.local/lib/python3.11/site-packages/torch/lib LD_PRELOAD=~/.local/lib/python3.11/site-packages/torch/lib/libtorch_cuda.so cargo run --release -- train-faster-rcnn --data-path data/b200c-detection --epochs 40 --learning-rate 1e-3 --device=1 --batch-size=16

to run the android app, copy the generated mobile weights to the app's app/src/main/assets.

Last runs

I usually put the run logs in logs.md for future reference.

Run inference

To run inference,

model-python:

python model-python/main.py predict --model data/model-python/faster_rcnn.pt --classes-file data/model-python/classes.txt --image input.png --output-image output.png --threshold 0.7 --device -1

model-rs:

cargo run --release -- predict --model data/model-rs/faster_rcnn --image input.png --output-image output.png --num-classes 200 --classes-file data/model-rs/classes.txt --threshold 0.7

Links