Spaces:
Runtime error
Runtime error
Commit ·
b313b80
1
Parent(s): a06400e
Add Content Moderation tab with video processing functionality and updated UI components
Browse files49 unmodified lines505152535455565758596061626364656667686970717273747576777879233 unmodified lines3133143152923163173183193203213223233243253263273283293303313323333343353363373383392 unmodified lines34234334434534634734834935035135235335449 unmodified lines return "Processing started. Results will be emailed to you shortly."
def process_video(video_path, notes, email, company_name): """ Process the input video for content moderation. Inputs: - video_path: path to the uploaded video file (str) - notes: department notes (str) - email: contact email (str) - company_name: company name (str) Output: - path to the output video file (str) For now, this is a placeholder that returns the input video unchanged. """ try: # In a real implementation, you would trigger your backend processing here. # For this demo, we simply return the original video path as the output. if not video_path: # Gradio expects None to clear the output component return None return video_path except Exception as e: logger.error(f"Error during video processing: {e}") return None
# Create a professional Gradio interface using the Golden ratio (1.618) for proportions# Define custom CSS for a professional lookcss = """233 unmodified lines with gr.Row(elem_classes="footer"): gr.Markdown("© BSOD.tv - Professional Dub Quality Control") with gr.Tab("Content Moderation"): pass # First Row: Left Department Notes (Textbox), Right Video input with gr.Row(elem_classes="input-section"): with gr.Column(scale=1): cm_notes = gr.Textbox(label="Department Notes", lines=6, placeholder="Enter notes for the moderation team...") with gr.Column(scale=1): cm_video_in = gr.Video(label="Video Input", sources=["upload"], interactive=True)
# Second Row: Email and Company Name (2/3 and 1/3 columns) with gr.Row(elem_classes="input-section"): with gr.Column(scale=2): cm_email = gr.Textbox(label="Email") with gr.Column(scale=1): cm_company_name = gr.Textbox(label="Company Name")
# Third Row: Single Video Output with gr.Row(elem_classes="output-section"): cm_video_out = gr.Video(label="Video Output")
# Final Row: Process button with gr.Row(): cm_process_btn = gr.Button("Process", variant="primary")
# Set up the processing function submit_btn.click(2 unmodified lines outputs=output )
# Wire Content Moderation processing cm_process_btn.click( fn=process_video, inputs=[cm_video_in, cm_notes, cm_email, cm_company_name], outputs=cm_video_out )
if __name__ == "__main__": # To run this file locally, you'll need to install gradio and requests: # pip install gradio requestsapp.py+52-1