dibrale / samist Goto Github PK
View Code? Open in Web Editor NEWSegment Anything Model (SAM) Image Segmentation Tool - SAMIST. Python GUI for image segmentation using SAM by Meta AI.
License: GNU Affero General Public License v3.0
Segment Anything Model (SAM) Image Segmentation Tool - SAMIST. Python GUI for image segmentation using SAM by Meta AI.
License: GNU Affero General Public License v3.0
I created a virtual environment named "samist" and followed the instructions as the readme file. But only succeed once at the first I run it. After that, whatever the picture or model I choose, the program will always show the error as follows:
(samist) E:\samist>python main.py
Starting Segment Anything Model Image Segmentation Tool (SAMIST)
Traceback (most recent call last):
File "E:\samist\main.py", line 302, in
[masks, [out_bw, out_full_res, masked_images, out_cropped]] = values[event]
ValueError: not enough values to unpack (expected 4, got 0)
I'm getting this while running in a fresh venv:
Traceback (most recent call last):
File "/samist/main.py", line 14, in <module>
from segment_anything import sam_model_registry, SamAutomaticMaskGenerator
File "/samist/env/lib/python3.9/site-packages/segment_anything/__init__.py", line 7, in <module>
from .build_sam import (
File "/samist/env/lib/python3.9/site-packages/segment_anything/build_sam.py", line 7, in <module>
import torch
ModuleNotFoundError: No module named 'torch'
Traceback (most recent call last):
File "/samist/main.py", line 14, in <module>
from segment_anything import sam_model_registry, SamAutomaticMaskGenerator
File "/samist/env/lib/python3.9/site-packages/segment_anything/__init__.py", line 14, in <module>
from .predictor import SamPredictor
File "/samist/env/lib/python3.9/site-packages/segment_anything/predictor.py", line 14, in <module>
from .utils.transforms import ResizeLongestSide
File "/samist/env/lib/python3.9/site-packages/segment_anything/utils/transforms.py", line 10, in <module>
from torchvision.transforms.functional import resize, to_pil_image # type: ignore
ModuleNotFoundError: No module named 'torchvision'
While it seems to be an upstream issue, after installing both torch
(version 2.0.1
) and torchvision
(version 0.15.2
) it seems to work fine.
Hello, Dear author, I met this error below,How can I fix that?
I use mac pro, python3.8 to run this。
Exception in thread Thread-2:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/Users/xx/Library/Python/3.8/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 11815, in _long_func_thread
return_value = original_func()
File "./main.py", line 266, in
lambda: segmentation(points_per_side, min_area, stability_thresh, predict_iou),
File "./main.py", line 58, in segmentation
sam = sam_model_registrymodel_type
File "/Users/xx/Library/Python/3.8/lib/python/site-packages/segment_anything/build_sam.py", line 15, in build_sam_vit_h
return _build_sam(
File "/Users/xx/Library/Python/3.8/lib/python/site-packages/segment_anything/build_sam.py", line 66, in _build_sam
sam = Sam(
File "/Users/xx/Library/Python/3.8/lib/python/site-packages/segment_anything/modeling/sam.py", line 46, in init
self.register_buffer("pixel_mean", torch.Tensor(pixel_mean).view(-1, 1, 1), False)
TypeError: register_buffer() takes 3 positional arguments but 4 were given
Do you have plans to design a web user interface, or do you have any suggestions on how to run this tool on a GPU server?
This may be a dumb question but what version of python are you using? I create my ENV and have had issues working with the latest version of python.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.