File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
- #Uploading video to colab for object detection
1
+ # Uploading video to colab for object detection
2
2
import cv2
3
3
from google .colab import files
4
4
from google .colab .patches import cv2_imshow
5
5
6
6
uploaded = files .upload ()
7
7
8
8
yourvideo = list (uploaded .keys ())[0 ]
9
- #once run, you will be promoted to select the video for object detection.
9
+ # once run, you will be promoted to select the video for object detection.
10
10
11
- #next cell, I like to break my code up so I can check for errors
12
- with open (yourvide , 'wb' ) as f :
13
- f .write (uploaded [yourvideo ]) #this write it to a file in Colab's runtime temporary file system
11
+ # next cell, I like to break my code up so I can check for errors
12
+ with open (yourvide , "wb" ) as f :
13
+ f .write (
14
+ uploaded [yourvideo ]
15
+ ) # this write it to a file in Colab's runtime temporary file system
14
16
15
- #preparing video for CV2 library
17
+ # preparing video for CV2 library
16
18
video = cv2 .VideoCapture (yourvideo )
17
19
if not video .isOpened ():
18
20
print ("Error opening video file" )
19
21
else :
20
- print ("Video successfully loaded and ready" )
21
-
22
-
22
+ print ("Video successfully loaded and ready" )
You can’t perform that action at this time.
0 commit comments