SaladSlayer00 commited on
Commit
72adf42
1 Parent(s): 939c610

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -77,12 +77,21 @@ def process_video(uploaded_video, name, surname, interval_ms):
77
  except Exception as e:
78
  return f"An error occurred: {e}", []
79
 
 
 
 
 
 
 
 
80
  # Gradio Interface
81
  with gr.Blocks() as demo:
82
- gr.Markdown("### Video Face Detector and Uploader")
 
 
83
  with gr.Row():
84
  with gr.Column():
85
- video = gr.File(label="Upload Your Video")
86
 
87
  with gr.Column():
88
  name = gr.Textbox(label="Name")
 
77
  except Exception as e:
78
  return f"An error occurred: {e}", []
79
 
80
+
81
+ example_video_path = "examples/vid.mp4"
82
+ if os.path.exists(example_video_path):
83
+ with open(example_video_path, "rb") as file:
84
+ example_video_bytes = file.read()
85
+ else:
86
+ example_video_bytes = None
87
  # Gradio Interface
88
  with gr.Blocks() as demo:
89
+ gr.Markdown("### Video Uploader and Face Detector")
90
+ gr.Markdown("Download the example video to try it out, or upload your own video to add your images to the dataset!")
91
+ gr.Markdown("Make a short 5-7 seconds video as shown in the example, with good lighting and visible face for best results.")
92
  with gr.Row():
93
  with gr.Column():
94
+ video = gr.File(label="Upload Your Video, Like This!", type="video", value=example_video_bytes)
95
 
96
  with gr.Column():
97
  name = gr.Textbox(label="Name")