leafqycc / rknn-multi-threaded

A simple demo of yolov5s running on rk3588/3588s using Python (about 72 frames). / 一个使用Python在rk3588/3588s上运行的yolov5s简单demo(大约72帧/s)。
Apache License 2.0
236 stars 41 forks source link

Add png mask file #10

Open lyazide opened 10 months ago

lyazide commented 10 months ago

Hi, Very nice work and I am impressed by the result on this small RK3588 Sbc. What would be the simplest way to add a png mask.png file to perform the detecting only in the unmaked area and display the final result on the full video?

leafqycc commented 10 months ago

The simplest method is to modify the draw function of line 161 under func.py. The cv2.rectangle function is used in the loop to check the drawing of the box body. The top left vertex of the box body is drawn as (top, left), and the bottom right vertex is (right, bottom). You only need to determine whether the vertex or the box is within the mask range, and if it is, contine enters the next loop without drawing the check box. Or you can try to copy an image of the current frame, and then paint mask.png as a full black overlay so that it cannot be detected, and then use the detection results of the overwritten image to paint the original frame image

Hi, Very nice work and I am impressed by the result on this small RK3588 Sbc. What would be the simplest way to add a png mask.png file to perform the detecting only in the unmaked area and display the final result on the full video?