output file nav
Browse files
main.py
CHANGED
|
@@ -27,6 +27,7 @@ print("[INFO]: Downloaded models!")
|
|
| 27 |
|
| 28 |
def poses(photo):
|
| 29 |
print("[INFO]: Running inference!")
|
|
|
|
| 30 |
result_generator = inferencer(photo,
|
| 31 |
vis_out_dir =".",
|
| 32 |
return_vis=True,
|
|
@@ -59,32 +60,10 @@ def poses(photo):
|
|
| 59 |
|
| 60 |
# out_writer.release()
|
| 61 |
# cv2.destroyAllWindows() # Closing window
|
| 62 |
-
|
| 63 |
-
print(
|
| 64 |
-
print(glob.glob("*.avi"))
|
| 65 |
-
|
| 66 |
-
cap = cv2.VideoCapture(os.path.join(output_file[0]))
|
| 67 |
-
formatfile = "test.mp4"
|
| 68 |
-
fourcc = cv2.VideoWriter_fourcc(*"mp4v") # Codec for MP4 video
|
| 69 |
-
fps = 32
|
| 70 |
-
height = 480
|
| 71 |
-
width = 640
|
| 72 |
-
size = (width,height)
|
| 73 |
-
|
| 74 |
-
out_writer = cv2.VideoWriter(formatfile, fourcc, fps, size)
|
| 75 |
-
|
| 76 |
-
while cap.isOpened():
|
| 77 |
-
ret, frame = cap.read()
|
| 78 |
-
out_writer.write(frame)
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
# Release everything if job is finished
|
| 82 |
-
cap.release()
|
| 83 |
-
out_writer.release()
|
| 84 |
-
cv2.destroyAllWindows()
|
| 85 |
-
|
| 86 |
|
| 87 |
-
return
|
| 88 |
|
| 89 |
|
| 90 |
|
|
|
|
| 27 |
|
| 28 |
def poses(photo):
|
| 29 |
print("[INFO]: Running inference!")
|
| 30 |
+
#vis_out_dir
|
| 31 |
result_generator = inferencer(photo,
|
| 32 |
vis_out_dir =".",
|
| 33 |
return_vis=True,
|
|
|
|
| 60 |
|
| 61 |
# out_writer.release()
|
| 62 |
# cv2.destroyAllWindows() # Closing window
|
| 63 |
+
output_files = glob.glob(os.path.join(".","*.mp4"))
|
| 64 |
+
print(output_files)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
+
return output_files[0]
|
| 67 |
|
| 68 |
|
| 69 |
|