Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -86,7 +86,7 @@ def rem_bg(vid): | |
| 86 | 
             
                    print (i)
         | 
| 87 | 
             
                    cv2.imwrite(f'{uid}-rembg/{i}.png',out)
         | 
| 88 | 
             
                    fbox2.append(f'{uid}-rembg/{i}.png')
         | 
| 89 | 
            -
                    frame_num=f'Working on {i+1} of { | 
| 90 | 
             
                    yield fbox2,frame_num,None
         | 
| 91 |  | 
| 92 | 
             
                out_vid = im_2_vid(fbox2, fps)
         | 
| @@ -196,6 +196,7 @@ with gr.Blocks() as app: | |
| 196 | 
             
                            #rem_vid=gr.Video()
         | 
| 197 | 
             
                            frame_num=gr.Textbox(label="Progress")
         | 
| 198 | 
             
                            rem_vid=gr.Gallery(columns=6)
         | 
|  | |
| 199 | 
             
                with gr.Row(visible=False):
         | 
| 200 | 
             
                    text_input=gr.Textbox()
         | 
| 201 | 
             
                    text_output=gr.Textbox()
         | 
| @@ -207,7 +208,7 @@ with gr.Blocks() as app: | |
| 207 | 
             
                trim_btn.click(trim_vid,[outp_vid,start_f,end_f],[out_trim,in_vid])
         | 
| 208 | 
             
                outp_vid.change(load_video,outp_vid,[frame_count,fps]).then(echo_fn,outp_vid,[out_trim])
         | 
| 209 | 
             
                frame_btn.click(capture_function,[out_trim],[frame_gal,frame_file])
         | 
| 210 | 
            -
                rem_btn.click(rem_bg,[out_trim],[rem_vid,frame_num])
         | 
| 211 | 
             
                go_btn.click(dl,inp_url,[outp_vid,outp_file,out_trim])
         | 
| 212 | 
             
                app.load(fn=predict, inputs=[text_input,url_params], outputs=[text_output,text_input],_js=load_js)
         | 
| 213 | 
             
            app.launch()
         | 
|  | |
| 86 | 
             
                    print (i)
         | 
| 87 | 
             
                    cv2.imwrite(f'{uid}-rembg/{i}.png',out)
         | 
| 88 | 
             
                    fbox2.append(f'{uid}-rembg/{i}.png')
         | 
| 89 | 
            +
                    frame_num=f'Working on {i+1} of {frame_count1-1}'
         | 
| 90 | 
             
                    yield fbox2,frame_num,None
         | 
| 91 |  | 
| 92 | 
             
                out_vid = im_2_vid(fbox2, fps)
         | 
|  | |
| 196 | 
             
                            #rem_vid=gr.Video()
         | 
| 197 | 
             
                            frame_num=gr.Textbox(label="Progress")
         | 
| 198 | 
             
                            rem_vid=gr.Gallery(columns=6)
         | 
| 199 | 
            +
                    rem_bg_vid=gr.Video()        
         | 
| 200 | 
             
                with gr.Row(visible=False):
         | 
| 201 | 
             
                    text_input=gr.Textbox()
         | 
| 202 | 
             
                    text_output=gr.Textbox()
         | 
|  | |
| 208 | 
             
                trim_btn.click(trim_vid,[outp_vid,start_f,end_f],[out_trim,in_vid])
         | 
| 209 | 
             
                outp_vid.change(load_video,outp_vid,[frame_count,fps]).then(echo_fn,outp_vid,[out_trim])
         | 
| 210 | 
             
                frame_btn.click(capture_function,[out_trim],[frame_gal,frame_file])
         | 
| 211 | 
            +
                rem_btn.click(rem_bg,[out_trim],[rem_vid,frame_num,rem_bg_vid])
         | 
| 212 | 
             
                go_btn.click(dl,inp_url,[outp_vid,outp_file,out_trim])
         | 
| 213 | 
             
                app.load(fn=predict, inputs=[text_input,url_params], outputs=[text_output,text_input],_js=load_js)
         | 
| 214 | 
             
            app.launch()
         | 
