We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 35f8e71 commit b935e2cCopy full SHA for b935e2c
advanced/segment-anything/sam.py
@@ -229,13 +229,11 @@ def generate_mask(self, url: str) -> PNGResponse:
229
# The below rendering code is copied from the segment-anything repo to draw the mask
230
# on top of the original image.
231
sorted_anns = sorted(masks, key=(lambda x: x["area"]), reverse=True)
232
- mask_img = np.ones(
233
- (
234
- sorted_anns[0]["segmentation"].shape[0],
235
- sorted_anns[0]["segmentation"].shape[1],
236
- 3,
237
- )
238
+ mask_img = np.ones((
+ sorted_anns[0]["segmentation"].shape[0],
+ sorted_anns[0]["segmentation"].shape[1],
+ 3,
+ ))
239
for ann in sorted_anns:
240
mask_img[ann["segmentation"]] = np.random.random(3)
241
alpha = 0.35
0 commit comments