Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -506,6 +506,7 @@ async def list_videos():
|
|
506 |
except Exception as e:
|
507 |
raise HTTPException(status_code=500, detail=f"Failed to fetch videos: {str(e)}")
|
508 |
|
|
|
509 |
@app.post("/extract-and-store-frames/")
|
510 |
async def extract_and_store_frames(file_name: str = Form(...)):
|
511 |
try:
|
@@ -549,7 +550,7 @@ async def extract_and_store_frames(file_name: str = Form(...)):
|
|
549 |
# Upload frames to Hugging Face dataset
|
550 |
for frame_file in os.listdir(frames_dir):
|
551 |
frame_path = os.path.join(frames_dir, frame_file)
|
552 |
-
|
553 |
path_in_repo=f"frames/{video_stem}/{frame_file}",
|
554 |
repo_id=DATASET_REPO,
|
555 |
repo_type="dataset",
|
|
|
506 |
except Exception as e:
|
507 |
raise HTTPException(status_code=500, detail=f"Failed to fetch videos: {str(e)}")
|
508 |
|
509 |
+
|
510 |
@app.post("/extract-and-store-frames/")
|
511 |
async def extract_and_store_frames(file_name: str = Form(...)):
|
512 |
try:
|
|
|
550 |
# Upload frames to Hugging Face dataset
|
551 |
for frame_file in os.listdir(frames_dir):
|
552 |
frame_path = os.path.join(frames_dir, frame_file)
|
553 |
+
api.upload_file(path_or_fileobj=frame_path,
|
554 |
path_in_repo=f"frames/{video_stem}/{frame_file}",
|
555 |
repo_id=DATASET_REPO,
|
556 |
repo_type="dataset",
|