Spaces:
Runtime error
Runtime error
Update app.py
Browse files11 unmodified lines12131415161718158 unmodified lines17717817918018118211 unmodified linesdef preprocess_image(image):return image, gr.State([]), gr.State([]), imagedef get_point(point_type, tracking_points, trackings_input_label, first_frame_path, evt):print(f"You selected {evt.value} at {evt.index} from {evt.target}")tracking_points.value.append(evt.index)158 unmodified linestrackings_input_label = gr.State([])with gr.Column():gr.Markdown("# SAM2 Image Predictor")with gr.Row():with gr.Column():input_image = gr.Image(label="input image", interactive=False, type="filepath", visible=False)11 unmodified lines12131415161718158 unmodified lines17717817918018118218318418518618718818919011 unmodified linesdef preprocess_image(image):return image, gr.State([]), gr.State([]), imagedef get_point(point_type, tracking_points, trackings_input_label, first_frame_path, evt: gr.SelectData):print(f"You selected {evt.value} at {evt.index} from {evt.target}")tracking_points.value.append(evt.index)158 unmodified linestrackings_input_label = gr.State([])with gr.Column():gr.Markdown("# SAM2 Image Predictor")gr.Markdown("This is a simple demo for image segmentation with SAM2.")gr.Markdown("""Instructions:1. Upload your image2. With 'include' point type selected, Click on the object to mask3. Switch to 'exclude' point type if you want to specify an area to avoid4. Submit !""")with gr.Row():with gr.Column():input_image = gr.Image(label="input image", interactive=False, type="filepath", visible=False)
app.py+9-1