Skip to content

Commit d42d627

Browse files
committed
Move colors import
1 parent f2386fc commit d42d627

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ text = [
7878
"groundingdino-py",
7979
]
8080
all = [
81-
"segment-geospatial[fast, hq, fer, samgeo, samgeo2, text]",
81+
"segment-geospatial[fast, hq, fer, samgeo, samgeo2, samgeo3, text]",
8282
]
8383
extra = [
8484
"leafmap",

samgeo/samgeo3.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ def show_anns(
476476
# Fallback to image dimensions
477477
w, h = img_pil.size
478478

479+
COLORS = generate_colors(n_colors=128, n_samples=5000)
480+
479481
for i in range(nb_objects):
480482
color = COLORS[i % len(COLORS)]
481483
plot_mask(results["masks"][i].squeeze(0).cpu(), color=color)
@@ -638,9 +640,6 @@ def generate_colors(n_colors=256, n_samples=5000):
638640
return colors_rgb
639641

640642

641-
COLORS = generate_colors(n_colors=128, n_samples=5000)
642-
643-
644643
def plot_bbox(
645644
img_height,
646645
img_width,

0 commit comments

Comments
 (0)