CASIA-IVA-Lab / FastSAM

Fast Segment Anything
GNU Affero General Public License v3.0
7.35k stars 687 forks source link

Some input images cause crashes #80

Closed colinator closed 1 year ago

colinator commented 1 year ago

If FastSAM finds nothing to segment, things crash. I've attached an image that crashes FastSAM-s (on your replicate link https://replicate.com/casia-iva-lab/fastsam). It yields this error:

Running predict()...
image 1/1 /tmp/tmp9i0napfutheimage.png: 448x576 (no detections), 107.1ms
Speed: 2.3ms preprocess, 107.1ms inference, 0.4ms postprocess per image at shape (1, 3, 576, 576)
Traceback (most recent call last):
File "/root/.pyenv/versions/3.8.17/lib/python3.8/site-packages/cog/server/worker.py", line 217, in _predict
result = predict(**payload)
File "predict.py", line 130, in predict
annotations=results[0].masks.data,
AttributeError: 'NoneType' object has no attribute 'data'

theimage

zxDeepDiver commented 1 year ago

OK, thanks for you nice feedback. We will fix it as soon as possible.

zxDeepDiver commented 1 year ago

Hi, recently we have solved this bug in this repository.