Update util.py
Browse files
util.py
CHANGED
|
@@ -17,12 +17,10 @@ def get_img_b64(file_path):
|
|
| 17 |
return base64.b64encode(file.read()).decode("utf-8")
|
| 18 |
|
| 19 |
def get_imgs_b64(file_path):
|
|
|
|
| 20 |
video = cv2.VideoCapture(file_path)
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
print(file_path)
|
| 24 |
-
print(video)
|
| 25 |
-
print("#######")
|
| 26 |
result = []
|
| 27 |
|
| 28 |
while video.isOpened():
|
|
@@ -33,9 +31,11 @@ def get_imgs_b64(file_path):
|
|
| 33 |
|
| 34 |
_, buffer = cv2.imencode(".png", frame)
|
| 35 |
result.append(base64.b64encode(buffer).decode("utf-8"))
|
| 36 |
-
|
| 37 |
-
video.release()
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
return result
|
| 40 |
|
| 41 |
def get_final_answer(model, question, answer):
|
|
|
|
| 17 |
return base64.b64encode(file.read()).decode("utf-8")
|
| 18 |
|
| 19 |
def get_imgs_b64(file_path):
|
| 20 |
+
print("111")
|
| 21 |
video = cv2.VideoCapture(file_path)
|
| 22 |
+
print("222")
|
| 23 |
+
|
|
|
|
|
|
|
|
|
|
| 24 |
result = []
|
| 25 |
|
| 26 |
while video.isOpened():
|
|
|
|
| 31 |
|
| 32 |
_, buffer = cv2.imencode(".png", frame)
|
| 33 |
result.append(base64.b64encode(buffer).decode("utf-8"))
|
|
|
|
|
|
|
| 34 |
|
| 35 |
+
print("333")
|
| 36 |
+
video.release()
|
| 37 |
+
print("444")
|
| 38 |
+
|
| 39 |
return result
|
| 40 |
|
| 41 |
def get_final_answer(model, question, answer):
|