Skip to main content

Complete guide for running the YOLOv8s object detection model on BOS Eagle-N hardware. This page covers model setup, weight downloading, inference execution with images and video, performance profiling, and optimization techniques.

yolov8s

Set environment variables

# at $TT_METAL_HOME
source env_set.sh

Download weights

python ./models/bos_model/yolov8s/weights_downloader.py

Run Test (Image)

python ./models/bos_model/yolov8s/run_yolov8s.py
  • input: reference/images
  • output: results

Run Test with Trace (Image)

python ./models/bos_model/yolov8s/run_yolov8s.py --trace -i 320 -n 10
  • Trace makes model execution much more fast.
  • Option i means the size of the image. Maximum I is 320.
  • 'n' means Number of iteration.

Run Video Demo

python ./models/bos_model/yolov8s/demo_yolov8s.py

Run for ttnn-visualizer Profiler

  • First, export environment variables using the script file. The experiment_name can be anything, for example yolo.
source models/bos_model/export_l1_vis.sh $EXPERIMENT_NAME
  • Second, run the model. If the model finishes running successfully, the result report will be generated in generated/ttnn/reports/EXPERIMENT_NAME_MMDD_hhmm/.
python ./models/bos_model/yolov8s/run_yolov8s.py
  • Third, run ttnn-visualizer. The report_path is the path mentioned in the previous step. Visit http://localhost:8000/ using your web browser.
ttnn-visualizer --profiler-path $REPORT_PATH
  • If the experiment has finished, please run the following command to clear the environment variables
source models/bos_model/unset_l1_vis.sh