We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9e7c96 commit f069069Copy full SHA for f069069
computer_vision/upload_video_cv
@@ -0,0 +1,21 @@
1
+#this script helps load video into colab environment. You should be asked to upload video.
2
+#recommend to seperate code into cells for testing purposes.
3
+import cv2
4
+from google.colab import files
5
+from google.colab.patches import cv2_imshow
6
+
7
+# Uploading the video
8
+uploaded = files.upload()
9
+your_video = list(uploaded.keys())[0]
10
11
+# Save the uploaded file to Colab's runtime temporary file system
12
+with open(your_video, 'wb') as f:
13
+ f.write(uploaded[your_video])
14
15
+# Preparing video for CV2 library
16
+video = cv2.VideoCapture(your_video)
17
18
+if not video.isOpened():
19
+ print("Error opening video file")
20
+else:
21
+ print("Video successfully loaded and ready")
0 commit comments