From 4a3364a0c312ace378689e1305da425c8fe925ce Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Tue, 6 Aug 2024 00:39:11 +0200 Subject: [PATCH] add mp4 to lfs --- .gitattributes | 1 + app.py | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index a6344aa..53aee21 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +*.mp4 filter=lfs diff=lfs merge=lfs -text diff --git a/app.py b/app.py index ec9f684..ef4f5cc 100644 --- a/app.py +++ b/app.py @@ -43,11 +43,16 @@ performs object segmentation on the image. """ IMAGE_PROCESSING_EXAMPLES = [ - [IMAGE_OPEN_VOCABULARY_DETECTION_MODE, "https://media.roboflow.com/notebooks/examples/dog-2.jpeg", 'straw, white napkin, black napkin, dog, hair, man'], + [IMAGE_OPEN_VOCABULARY_DETECTION_MODE, "https://media.roboflow.com/notebooks/examples/dog-2.jpeg", 'straw, white napkin, black napkin, hair'], [IMAGE_OPEN_VOCABULARY_DETECTION_MODE, "https://media.roboflow.com/notebooks/examples/dog-3.jpeg", 'tail'], [IMAGE_CAPTION_GROUNDING_MASKS_MODE, "https://media.roboflow.com/notebooks/examples/dog-2.jpeg", None], [IMAGE_CAPTION_GROUNDING_MASKS_MODE, "https://media.roboflow.com/notebooks/examples/dog-3.jpeg", None], ] +VIDEO_PROCESSING_EXAMPLES = [ + ["videos/clip-07-camera-1.mp4", "player in white outfit, player in black outfit, ball, rim"], + ["videos/clip-07-camera-2.mp4", "player in white outfit, player in black outfit, ball, rim"], + ["videos/clip-07-camera-3.mp4", "player in white outfit, player in black outfit, ball, rim"] +] VIDEO_SCALE_FACTOR = 0.5 VIDEO_TARGET_DIRECTORY = "tmp" @@ -328,6 +333,18 @@ with gr.Blocks() as demo: with gr.Column(): video_processing_video_output_component = gr.Video( label='Video output') + with gr.Row(): + gr.Examples( + fn=process_video, + examples=VIDEO_PROCESSING_EXAMPLES, + inputs=[ + video_processing_mode_dropdown_component, + video_processing_video_input_component, + video_processing_text_input_component + ], + outputs=video_processing_video_output_component, + run_on_click=True + ) image_processing_submit_button_component.click( fn=process_image,