Spaces:
Runtime error
Runtime error
File size: 595 Bytes
5c0b534 9b4ee8f 6b8e3c4 9b4ee8f 5c0b534 6b8e3c4 5c0b534 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import gradio as gr
from segment_anything import SamAutomaticMaskGenerator, sam_model_registry
import supervision as sv
from inference import DepthPredictor, SegmentPredictor
def snap(image, video):
depth_predictor = DepthPredictor()
#segment_predictor = SegmentPredictor()
#sam_result = segment_predictor.predict(image)
depth_result = depth_predictor.predict(image)
return [depth_result, video]
demo = gr.Interface(
snap,
[gr.Image(source="webcam", tool=None), gr.Video(source="webcam")],
["image", "video"],
)
if __name__ == "__main__":
demo.launch() |