Evaluation
Overview
Testing
CLI
Command Line
1luxonis_train test --config configs/detection_light_model.yaml \
2 --view val \
3 --weights path/to/checkpoint.ckptPython API
Python
1from luxonis_train import LuxonisModel
2
3model = LuxonisModel("configs/detection_light_model.yaml")
4model.test(weights="path/to/checkpoint.ckpt")Note: The testing process can be started automatically at the end of the training by using the TestOnTrainEnd callback.
Inference
CLI
Inference on a Dataset View
Command Line
1luxonis_train infer --config configs/detection_light_model.yaml \
2 --view val \
3 --weights path/to/checkpoint.ckptInference on a Video File
Command Line
1luxonis_train infer --config configs/detection_light_model.yaml \
2 --weights path/to/checkpoint.ckpt \
3 --source-path path/to/video.mp4Inference on an Image Directory
Command Line
1luxonis_train infer --config configs/detection_light_model.yaml \
2 --weights path/to/checkpoint.ckpt \
3 --source-path path/to/imagesInference on a single Image
Command Line
1luxonis_train infer --config configs/detection_light_model.yaml \
2 --weights path/to/checkpoint.ckpt \
3 --source-path path/to/image.jpgPython API
Python
1from luxonis_train import LuxonisModel
2
3model = LuxonisModel("configs/detection_light_model.yaml")
4
5# Infer on a dataset view
6model.infer(weights="path/to/checkpoint.ckpt", view="val")
7
8# Infer on a video file
9model.infer(weights="path/to/checkpoint.ckpt", source_path="path/to/video.mp4")
10
11# Infer on an image directory and save the results
12model.infer(
13 weights="path/to/checkpoint.ckpt",
14 source_path="path/to/images",
15 save_dir="path/to/save_directory",
16)