Tähän video, tarvitsee testvideomp4.yaml edukamu-komponentin, jos käytetään videoita mp4:na, pelkkä url kansioon ei tunnista videoformaattia
Now that we can use YOLO in Google Colab, we can move on to adding a video for object detection. There are multiple ways of getting a video into your setting, and one of the simplest ways to do so is this.
from google.colab import files
uploaded = files.upload()
At this point, you can choose what video you wish to use. When the uploading process is finished, check the path you located, it must be ‘darknet’.
!pwd
/content/darknet
Be careful during this process, Darknet seems to crash if you provide the wrong type of output file extension (non .avi), the syntax should be exactly the same.
In this example, we will be using a clip titled "miniature-traffic-road-Z4K357A.mp4", and we're going to get "outtraf.avi" in return. We recommend that you choose your own video clips with different titles for this, so you don't get the exact same results as in this example.
#output_video_name = "miniature-traffic-road-Z4K357A.mp4"
#%cd ..
!./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights -dont_show miniature-traffic-road-Z4K357A.mp4 -i 0 -out_filename outtraf.avi -thresh 0.7
Tähän video, tarvitsee testvideomp4.yaml edukamu-komponentin, jos käytetään videoita mp4:na, pelkkä url kansioon ei tunnista videoformaattia