Skip to content

Commit

Permalink
Merge pull request #1479 from rolalaro/doc_misc
Browse files Browse the repository at this point in the history
Improvements of the tutorial documentation
  • Loading branch information
fspindle authored Oct 15, 2024
2 parents 222acac + a526b11 commit a65eebc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/tutorial/detection_dnn/tutorial-detection-dnn.dox
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ If you want to train your own YoloV7 model, please refer to the [official docume
If your dataset is rather small (only hundreds of pictures), you may want to consider to base your training on
`yolov7-tiny` network, as it tends to get better results.

\warning If you train your own model, be sure to use the same image size in the `python train.py`,
`python export.py` and `./tutorial-dnn-object-detection-live` commands. Otherwise, it can lead to either an error thrown
by OpenCV or the absence of detection by the ONNX model while the Pytorch model works perfectly using the `python detect.py` command.

\subsubsection dnn_supported_yolov8 Yolo v8

You can find the weights (`yolov8s.onnx`) in ONNX format
Expand Down
4 changes: 4 additions & 0 deletions doc/tutorial/misc/tutorial-synthetic-blenderproc.dox
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,10 @@ We also download the pretrained yolo model, that we will finetune on our own dat
(yolov7) ~/yolov7 $ wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-tiny.pt
```

\warning While creating the yolov7 virtual environment, you may face the following error:
"requirements to build wheel did not run successfully". It can be solved by fixing the version of the Python of
the virtual environment: `conda create --name yolov7 pip python=3.10`

To fine-tune a YoloV7, we should create two new files: the network configuration and the hyperparameters.
We will reuse the ones provided for the tiny model.
```
Expand Down
5 changes: 5 additions & 0 deletions tutorial/detection/dnn/tutorial-dnn-object-detection-live.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ int main(int argc, const char *argv[])
cv::Mat frame;
while (true) {
capture >> frame;
if (frame.type() == CV_8UC4) {
// RGBa format is not supported by the class, converting to BGR format
cv::Mat cpy = frame;
cv::cvtColor(cpy, frame, cv::COLOR_RGBA2BGR);
}
if (frame.empty())
break;

Expand Down

0 comments on commit a65eebc

Please sign in to comment.