Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -50,13 +50,14 @@ def capture_function(vid=None,frame_count=None):
|
|
50 |
capture.set(cv2.CAP_PROP_POS_FRAMES, i)
|
51 |
ret, frame_f = capture.read(i)
|
52 |
frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
|
53 |
-
|
54 |
fbox.append(f'{uid}-{i}.png')
|
55 |
|
56 |
capture.set(cv2.CAP_PROP_POS_FRAMES, int(frame_count)-1)
|
57 |
ret, frame_f = capture.read()
|
58 |
frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
|
59 |
-
|
|
|
60 |
capture.release()
|
61 |
return fbox,fbox
|
62 |
|
|
|
50 |
capture.set(cv2.CAP_PROP_POS_FRAMES, i)
|
51 |
ret, frame_f = capture.read(i)
|
52 |
frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
|
53 |
+
cv2.imwrite(f'{uid}-{i}.png',frame_ff)
|
54 |
fbox.append(f'{uid}-{i}.png')
|
55 |
|
56 |
capture.set(cv2.CAP_PROP_POS_FRAMES, int(frame_count)-1)
|
57 |
ret, frame_f = capture.read()
|
58 |
frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
|
59 |
+
cv2.imwrite(f'{uid}-{int(frame_count)-1}.png',frame_ff)
|
60 |
+
fbox.append(f'{uid}-{int(frame_count)-1}.png')
|
61 |
capture.release()
|
62 |
return fbox,fbox
|
63 |
|