Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Author

@rtyley rtyley Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we're updating the Import Package in this example to match the name given in the HQ-SAM documentation:

from segment_anything_hq import sam_model_registry

Note that in order for this to work, we need to rename the /segment-anything/ folder to /segment-anything-hq/ (which in Git, means a lot of files get their paths renamed).

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.
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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit of configuration isn't crucial - it only relates to isort configuration, to ensure that when python code imports are sorted, they are sorted in a sensible fashion. Strangely, although isort documents several other known_... settings (eg known_third_party), it doesn't document known_myself, and that identifier doesn't appear anywhere in the isort codebase.

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",
Copy link
Author

@rtyley rtyley Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is the crucial fix for the "Generating metadata for package segment-anything-hq produced metadata for project name segment-anything" error - here, we're correcting the Distribution Package name as used by pip, rather than the Import Package.

See also pypa/pipenv#5445 (comment)

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