This project involves training object detection models using the YOLOv5 framework, exporting the trained model from .pt
format to .pb
format, and testing the performance of the model. The new data should be imported to the appropriate directory as described below.
total_data
under the project directory and place the newly imported data there.192.168.20.250
/data/object_detection
Run the following script to train the model, where <project_name>
is the name of the newly created project:
./object_detection.sh /data2/object_detection/data/image/<project_name>/
.pt
format..pb
FormatTo export the .pt
model to .pb
format, first find the .pt
file path by running:
cat export.sh
Navigate to the YOLOv5 directory:
cd /data/object_detection/code/yolov5/
Run the export script to convert the .pt
model to .pb
format:
python export.py --weights ./runs/train/helmet_fall_phone/weights/best.pt --include pb
helmet_fall_phone
to the correct project name before running the script.To test the model, run the following command:
python detect.py --weights runs/train/safebelt_data/weights/best.pt --source /data2/object_detection/code/yolov5/safebelt_test --data /data2/object_detection/data/image/safebelt_data/yolo/safebelt_data.yaml --device 0
--weights
, --source
, and --data
parameters to the correct project paths.For any inquiries or issues, please contact the development team.