jens
depth estimation
6b8e3c4
raw
history blame
595 Bytes
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()