sam2 / README.md
John Ho
added input validation
b2e3d42

A newer version of the Gradio SDK is available: 5.42.0

Upgrade
metadata
title: Sam2
emoji: πŸ“š
colorFrom: blue
colorTo: yellow
sdk: gradio
sdk_version: 5.32.0
app_file: app.py
pinned: false
short_description: sam2 images and video inference on ZeroGPU

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Changelog

this huggingspace demo borrows extensively from SkalskiP/florence-sam. Here are some changes that's noteworthy:

  • the RuntimeError: No available kernel. Aborting execution. error documented here, here, and here is fixed with the following lines in app.py (see this commit) with the @torch.inference_mode() and @torch.autocast(device_type="cuda", dtype=torch.bfloat16) before the inference function:
torch.autocast(device_type="cuda", dtype=torch.bfloat16).__enter__()
if torch.cuda.get_device_properties(0).major >= 8:
    torch.backends.cuda.matmul.allow_tf32 = True
    torch.backends.cudnn.allow_tf32 = True