Skip to content

Commit

Permalink
lint (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yangqing authored Dec 12, 2023
1 parent 35f8e71 commit b935e2c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions advanced/segment-anything/sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,11 @@ def generate_mask(self, url: str) -> PNGResponse:
# The below rendering code is copied from the segment-anything repo to draw the mask
# on top of the original image.
sorted_anns = sorted(masks, key=(lambda x: x["area"]), reverse=True)
mask_img = np.ones(
(
sorted_anns[0]["segmentation"].shape[0],
sorted_anns[0]["segmentation"].shape[1],
3,
)
)
mask_img = np.ones((
sorted_anns[0]["segmentation"].shape[0],
sorted_anns[0]["segmentation"].shape[1],
3,
))
for ann in sorted_anns:
mask_img[ann["segmentation"]] = np.random.random(3)
alpha = 0.35
Expand Down

0 comments on commit b935e2c

Please sign in to comment.