Skip to content

Commit

Permalink
Fix inconsistent pip package name
Browse files Browse the repository at this point in the history
This project is released as `segment-anything-hq` in pip:

https://pypi.org/project/segment-anything-hq/

...but the setup here just said `segment_anything`, which seems to be the cause of this error message:

```
WARNING: Generating metadata for package segment-anything-hq produced metadata for project name segment-anything
```

...while trying to pip install a requirements file that had a line like this:

```
segment-anything-hq @ git+https://github.com/SysCV/sam-hq@5fd027ec559806dec9f876b56938175a63dfc625
```

Full error logs:
```
Collecting segment-anything-hq@ git+https://github.com/SysCV/sam-hq@5fd027ec559806dec9f876b56938175a63dfc625 (from -r requirements.txt (line 9))
  Cloning https://github.com/SysCV/sam-hq (to revision 5fd027e) to /private/var/folders/28/pjfz24p92bxcj5j7gsnnk9xm0000gp/T/pip-install-cmpqwucv/segment-anything-hq_bd753024d0a540f5bcb3225886933667
  Running command git clone --filter=blob:none --quiet https://github.com/SysCV/sam-hq /private/var/folders/28/pjfz24p92bxcj5j7gsnnk9xm0000gp/T/pip-install-cmpqwucv/segment-anything-hq_bd753024d0a540f5bcb3225886933667
  Running command git rev-parse -q --verify 'sha^5fd027ec559806dec9f876b56938175a63dfc625'
  Running command git fetch -q https://github.com/SysCV/sam-hq 5fd027e
  Resolved https://github.com/SysCV/sam-hq to commit 5fd027e
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  WARNING: Generating metadata for package segment-anything-hq produced metadata for project name segment-anything. Fix your #egg=segment-anything-hq fragments.
Discarding git+https://github.com/SysCV/sam-hq@5fd027ec559806dec9f876b56938175a63dfc625: Requested segment-anything from git+https://github.com/SysCV/sam-hq@5fd027ec559806dec9f876b56938175a63dfc625 (from -r requirements.txt (line 9)) has inconsistent name: expected 'segment-anything-hq', but metadata has 'segment-anything'
```

See also: pypa/pipenv#5445 (comment)
  • Loading branch information
rtyley committed Oct 23, 2023
1 parent 5fd027e commit bfd53dd
Show file tree
Hide file tree
Showing 22 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion demo/demo_hqsam.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import torch
import matplotlib.pyplot as plt
import cv2
from segment_anything import sam_model_registry, SamPredictor
from segment_anything_hq import sam_model_registry, SamPredictor
import os

def show_mask(mask, ax, random_color=False):
Expand Down
2 changes: 1 addition & 1 deletion demo/demo_hqsam_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import torch
import matplotlib.pyplot as plt
import cv2
from segment_anything import sam_model_registry, SamPredictor
from segment_anything_hq import sam_model_registry, SamPredictor
import os

def show_mask(mask, ax, random_color=False):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ multi_line_output=3
include_trailing_comma=True
known_standard_library=numpy,setuptools
skip_glob=*/__init__.py
known_myself=segment_anything
known_myself=segment_anything_hq
known_third_party=matplotlib,cv2,torch,torchvision,pycocotools,onnx,black,isort
no_lines_before=STDLIB,THIRDPARTY
sections=FUTURE,STDLIB,THIRDPARTY,MYSELF,FIRSTPARTY,LOCALFOLDER
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from setuptools import find_packages, setup

setup(
name="segment_anything",
name="segment_anything_hq",
version="1.0",
install_requires=[],
packages=find_packages(exclude="notebooks"),
Expand Down

0 comments on commit bfd53dd

Please sign in to comment.