mirror of
https://github.com/Vision-CAIR/MiniGPT-4.git
synced 2025-04-09 04:20:46 +00:00
test
This commit is contained in:
parent
c33e75d3a3
commit
08992cc8a3
@ -73,7 +73,7 @@ class GroundingModule(nn.Module):
|
|||||||
x0, y0, x1, y1 = box
|
x0, y0, x1, y1 = box
|
||||||
x0, y0, x1, y1 = int(x0), int(y0), int(x1), int(y1)
|
x0, y0, x1, y1 = int(x0), int(y0), int(x1), int(y1)
|
||||||
|
|
||||||
draw.rectangle([x0, y0, x1, y1], outline=color, width=6)
|
draw.rectangle([x0, y0, x1, y1], outline=color, width=10)
|
||||||
|
|
||||||
if boxes.size(0) > 0:
|
if boxes.size(0) > 0:
|
||||||
boxes = boxes * torch.Tensor([W, H, W, H])
|
boxes = boxes * torch.Tensor([W, H, W, H])
|
||||||
@ -115,5 +115,5 @@ class GroundingModule(nn.Module):
|
|||||||
full_img[m != 0] = color_mask
|
full_img[m != 0] = color_mask
|
||||||
full_img = (full_img * 255).astype(np.uint8)
|
full_img = (full_img * 255).astype(np.uint8)
|
||||||
full_img = PIL.Image.fromarray(full_img)
|
full_img = PIL.Image.fromarray(full_img)
|
||||||
PIL.Image.blend(draw_img, full_img, 0.5)
|
draw_img = PIL.Image.blend(draw_img, full_img, 0.5)
|
||||||
return draw_img
|
return draw_img
|
||||||
|
Loading…
Reference in New Issue
Block a user