facebookresearch / facebookresearch/segment-anything

pic should be Tensor or ndarray. Got <class 'numpy.ndarray'>

Open
#767 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
54.9k
Forks
6.4k
PR merge metrics
No merged PRs in 30d

Description

I followed the ReadMe.md step by step, but the image read by `cv2.imread` cannot work in `mask_generator.generate`
It raised a `TypeError: pic should be Tensor or ndarray. Got `, why `` is not `ndarray`?????
![1719379085725](https://github.com/facebookresearch/segment-anything/assets/80079120/1981a939-ff3d-4031-8727-3391487b2e2d)

Contributor guide

Open the contributing guide

Research direction

Reproduce the README.md workflow using cv2.imread and mask_generator.generate, then inspect the image type at the handoff where the TypeError occurs. Compare the reported type with the type accepted by generate; done means the cause is documented and the README workflow either succeeds or clearly states the required compatibility conditions.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, opencv, python
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.