Spaces:
				
			
			
	
			
			
		Paused
		
	
	
	
			
			
	
	
	
	
		
		
		Paused
		
	Commit 
							
							·
						
						0f36c5b
	
1
								Parent(s):
							
							13abc4d
								
bump
Browse files
    	
        app.py
    CHANGED
    
    | @@ -1,4 +1,5 @@ | |
| 1 | 
             
            import gradio as gr
         | 
|  | |
| 2 | 
             
            import torch
         | 
| 3 | 
             
            import os
         | 
| 4 | 
             
            import tempfile
         | 
| @@ -65,6 +66,8 @@ def extract_frames_from_video(video_path, output_dir, max_frames=81): | |
| 65 |  | 
| 66 | 
             
                return len(frames[:max_frames]), fps
         | 
| 67 |  | 
|  | |
|  | |
| 68 | 
             
            def generate_recammaster_video(
         | 
| 69 | 
             
                video_file,
         | 
| 70 | 
             
                text_prompt,
         | 
| @@ -151,15 +154,13 @@ def generate_recammaster_video( | |
| 151 | 
             
            # Create Gradio interface
         | 
| 152 | 
             
            with gr.Blocks(title="ReCamMaster") as demo:
         | 
| 153 |  | 
| 154 | 
            -
                demo_notice = " | 
| 155 |  | 
| 156 | 
             
                gr.Markdown(f"""
         | 
| 157 | 
             
                # ReCamMaster 🎥
         | 
| 158 |  | 
| 159 | 
             
                This is a demo of [ReCamMaster](https://jianhongbai.github.io/ReCamMaster/), an amazing model that allows you to reshoot any video!
         | 
| 160 | 
            -
             | 
| 161 | 
            -
                Due to the long generation times (~ 10 min for 50 steps of 81 frames) this space has be artificially limited to 25 steps, and [should be duplicated](https://huggingface.co/spaces/jbilcke-hf/ReCamMaster?duplicate=true) to your own account for the best experience (please select at least a Nvidia L40S).
         | 
| 162 | 
            -
                
         | 
| 163 | 
             
                {demo_notice}
         | 
| 164 | 
             
                """)
         | 
| 165 |  | 
| @@ -168,7 +169,7 @@ with gr.Blocks(title="ReCamMaster") as demo: | |
| 168 | 
             
                        # Video input section
         | 
| 169 | 
             
                        with gr.Group():
         | 
| 170 | 
             
                            gr.Markdown("### 1. Upload a video (about ~3 sec long)")
         | 
| 171 | 
            -
                            video_input = gr.Video(label="Video file  | 
| 172 | 
             
                            text_prompt = gr.Textbox(
         | 
| 173 | 
             
                                label="Describe the scene",
         | 
| 174 | 
             
                                placeholder="A person walking in the street",
         | 
|  | |
| 1 | 
             
            import gradio as gr
         | 
| 2 | 
            +
            import spaces
         | 
| 3 | 
             
            import torch
         | 
| 4 | 
             
            import os
         | 
| 5 | 
             
            import tempfile
         | 
|  | |
| 66 |  | 
| 67 | 
             
                return len(frames[:max_frames]), fps
         | 
| 68 |  | 
| 69 | 
            +
            # compute takes at least 5 min so we cannot use ZeroGPU
         | 
| 70 | 
            +
            # @spaces.GPU(duration=300)
         | 
| 71 | 
             
            def generate_recammaster_video(
         | 
| 72 | 
             
                video_file,
         | 
| 73 | 
             
                text_prompt,
         | 
|  | |
| 154 | 
             
            # Create Gradio interface
         | 
| 155 | 
             
            with gr.Blocks(title="ReCamMaster") as demo:
         | 
| 156 |  | 
| 157 | 
            +
                demo_notice = "ℹ️ Due to the long generation times (~ 10 min for 50 steps of 81 frames) this space has be artificially limited to 25 steps, and [should be duplicated](https://huggingface.co/spaces/jbilcke-hf/ReCamMaster?duplicate=true) to your own account for the best experience (please select at least a Nvidia L40S)." if IS_DEMO else ""
         | 
| 158 |  | 
| 159 | 
             
                gr.Markdown(f"""
         | 
| 160 | 
             
                # ReCamMaster 🎥
         | 
| 161 |  | 
| 162 | 
             
                This is a demo of [ReCamMaster](https://jianhongbai.github.io/ReCamMaster/), an amazing model that allows you to reshoot any video!
         | 
| 163 | 
            +
             | 
|  | |
|  | |
| 164 | 
             
                {demo_notice}
         | 
| 165 | 
             
                """)
         | 
| 166 |  | 
|  | |
| 169 | 
             
                        # Video input section
         | 
| 170 | 
             
                        with gr.Group():
         | 
| 171 | 
             
                            gr.Markdown("### 1. Upload a video (about ~3 sec long)")
         | 
| 172 | 
            +
                            video_input = gr.Video(label="Video file or webcam clip")
         | 
| 173 | 
             
                            text_prompt = gr.Textbox(
         | 
| 174 | 
             
                                label="Describe the scene",
         | 
| 175 | 
             
                                placeholder="A person walking in the street",
         | 
