Instructions to use riversnow/so101-segmentation-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use riversnow/so101-segmentation-model with ultralytics:
# Couldn't find a valid YOLO version tag. # Replace XX with the correct version. from ultralytics import YOLOvXX model = YOLOvXX.from_pretrained("riversnow/so101-segmentation-model") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Unable to load weights after downloading
Hello, I'm trying to run the model going off of the example code, but by downloading best.pt i get a folder with pickled files and other stuff (data, data.pkl), i don't know if this i intended or i Xet is does this when somebody tries to download larger files from the Hub, but any help is appreciated
I was able to recover the .pt file with this:
import zipfile
import os
folder = "model_folder" # path to your extracted folder
output = "recovered_model.pt"
The archive name (subdirectory prefix) β usually "archive" for PyTorch
archive_name = "archive"
valid_time = (1980, 1, 1, 0, 0, 0)
def add_file(zf, disk_path, zip_path):
with open(disk_path, "rb") as f:
data = f.read()
info = zipfile.ZipInfo(zip_path)
info.date_time = valid_time
zf.writestr(info, data)
with zipfile.ZipFile(output, "w") as zf:
for filename in ["data.pkl", "byteorder", "version"]:
add_file(zf, os.path.join(folder, filename), f"{archive_name}/{filename}")
for f in os.listdir(os.path.join(folder, "data")):
add_file(zf, os.path.join(folder, "data", f), f"{archive_name}/data/{f}")
print("Done! Saved to", output)
this is surprising - can you let me know how you cloned the repo?, was it just a git clone?
this is surprising - can you let me know how you cloned the repo?, was it just a git clone?
I actually downloaded 'best.pt' directly from the Hub web interface (the download button on the file bar). Also, any info on the training distribution for the model? (mostly interested in embodiment and environment colors or other visual stuff like that).
p.s. very cool model, thanks
Yeah!, training data is here https://huggingface.co/datasets/riversnow/so101-segmentation, it's trained on 4000 synthetically generated images and 110 hand-labelled images (hand labelled by me)
I generated the synthetic data using https://github.com/johnsutor/so101-nexus, the supplimental background stuff I used is mentioned here https://huggingface.co/datasets/riversnow/so101-segmentation I didn't document the backgrounds I used π
Also thank you!, I didn't actually realise how popular this got until now