|
@@ -12,7 +12,7 @@ This project involves training object detection models using the YOLOv5 framewor
|
|
|
|
|
|
### 2. Model Training
|
|
### 2. Model Training
|
|
- Run the following script to train the model, where `<project_name>` is the name of the newly created project:
|
|
- Run the following script to train the model, where `<project_name>` is the name of the newly created project:
|
|
- ```bash
|
|
|
|
|
|
+ ```
|
|
./object_detection.sh /data2/object_detection/data/image/<project_name>/
|
|
./object_detection.sh /data2/object_detection/data/image/<project_name>/
|
|
```
|
|
```
|
|
|
|
|
|
@@ -21,22 +21,22 @@ This project involves training object detection models using the YOLOv5 framewor
|
|
|
|
|
|
### 4. Export Model to `.pb` Format
|
|
### 4. Export Model to `.pb` Format
|
|
- To export the `.pt` model to `.pb` format, first find the `.pt` file path by running:
|
|
- To export the `.pt` model to `.pb` format, first find the `.pt` file path by running:
|
|
- ```bash
|
|
|
|
|
|
+ ```
|
|
cat export.sh
|
|
cat export.sh
|
|
```
|
|
```
|
|
- Navigate to the YOLOv5 directory:
|
|
- Navigate to the YOLOv5 directory:
|
|
- ```bash
|
|
|
|
|
|
+ ```
|
|
cd /data/object_detection/code/yolov5/
|
|
cd /data/object_detection/code/yolov5/
|
|
```
|
|
```
|
|
- Run the export script to convert the `.pt` model to `.pb` format:
|
|
- Run the export script to convert the `.pt` model to `.pb` format:
|
|
- ```bash
|
|
|
|
|
|
+ ```
|
|
python export.py --weights ./runs/train/helmet_fall_phone/weights/best.pt --include pb
|
|
python export.py --weights ./runs/train/helmet_fall_phone/weights/best.pt --include pb
|
|
```
|
|
```
|
|
- *Note*: Change `helmet_fall_phone` to the correct project name before running the script.
|
|
- *Note*: Change `helmet_fall_phone` to the correct project name before running the script.
|
|
|
|
|
|
### 5. Model Testing
|
|
### 5. Model Testing
|
|
- To test the model, run the following command:
|
|
- To test the model, run the following command:
|
|
- ```bash
|
|
|
|
|
|
+ ```
|
|
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
|
|
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
|
|
```
|
|
```
|
|
- *Note*: Adjust the `--weights`, `--source`, and `--data` parameters to the correct project paths.
|
|
- *Note*: Adjust the `--weights`, `--source`, and `--data` parameters to the correct project paths.
|