Update app.py
Browse files
app.py
CHANGED
@@ -282,12 +282,9 @@ def depth_edges_mask(depth):
|
|
282 |
mask = depth_grad > 0.05
|
283 |
return mask
|
284 |
|
285 |
-
def rgb2gray(rgb):
|
286 |
-
return np.dot(rgb[...,:3], [0.333, 0.333, 0.333])
|
287 |
-
|
288 |
def blur_image(image, depth, blur_data):
|
289 |
blur_a = blur_data.split()
|
290 |
-
|
291 |
|
292 |
blur_frame = image.copy()
|
293 |
j = 0
|
@@ -732,8 +729,9 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
|
|
732 |
{"lat": 50.073823157821664, "lng": 14.437124189538856, "heading": 152.95769, "pitch": 4.233024999999998}
|
733 |
]"""
|
734 |
coords = gr.Textbox(elem_id="coords", value=example_coords, label="Coordinates", interactive=False)
|
|
|
735 |
input_json.input(show_json, inputs=[input_json], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, coords])
|
736 |
-
|
737 |
|
738 |
def on_submit(uploaded_video,model_type,blur_in,boffset,bsize,coordinates):
|
739 |
global locations
|
@@ -776,7 +774,7 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
|
|
776 |
|
777 |
return output_video_path + (json.dumps(locations),)
|
778 |
|
779 |
-
|
780 |
submit.click(on_submit, inputs=[input_video, model_type, blur_in, boffset, bsize, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, depth_video, coords])
|
781 |
|
782 |
example_files = [["./examples/streetview.mp4", "vits", blurin, 1, 32, example_coords]]
|
|
|
282 |
mask = depth_grad > 0.05
|
283 |
return mask
|
284 |
|
|
|
|
|
|
|
285 |
def blur_image(image, depth, blur_data):
|
286 |
blur_a = blur_data.split()
|
287 |
+
print(f'blur data {blur_data}')
|
288 |
|
289 |
blur_frame = image.copy()
|
290 |
j = 0
|
|
|
729 |
{"lat": 50.073823157821664, "lng": 14.437124189538856, "heading": 152.95769, "pitch": 4.233024999999998}
|
730 |
]"""
|
731 |
coords = gr.Textbox(elem_id="coords", value=example_coords, label="Coordinates", interactive=False)
|
732 |
+
render = gr.Button("Render")
|
733 |
input_json.input(show_json, inputs=[input_json], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, coords])
|
734 |
+
|
735 |
|
736 |
def on_submit(uploaded_video,model_type,blur_in,boffset,bsize,coordinates):
|
737 |
global locations
|
|
|
774 |
|
775 |
return output_video_path + (json.dumps(locations),)
|
776 |
|
777 |
+
render.click(None, inputs=None, outputs=None, js=load_model)
|
778 |
submit.click(on_submit, inputs=[input_video, model_type, blur_in, boffset, bsize, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, depth_video, coords])
|
779 |
|
780 |
example_files = [["./examples/streetview.mp4", "vits", blurin, 1, 32, example_coords]]
|