mirror of
https://github.com/gaomingqi/Track-Anything.git
synced 2025-12-15 16:07:51 +01:00
update README and base_inpainter (fix resizing)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,3 +9,4 @@ debug_images/
|
||||
*.npy
|
||||
images/
|
||||
test_sample/
|
||||
doc/
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<img src="https://img.shields.io/badge/%F0%9F%93%96-Arxiv_2304.11968-red.svg?style=flat-square">
|
||||
</a>
|
||||
<a src="https://img.shields.io/badge/%F0%9F%A4%97-Open_in_Spaces-informational.svg?style=flat-square" href="https://huggingface.co/spaces/watchtowerss/Track-Anything?duplicate=trueg">
|
||||
<img src="https://img.shields.io/badge/%F0%9F%A4%97-Open_in_Spaces-informational.svg?style=flat-square">
|
||||
<img src="https://img.shields.io/badge/%F0%9F%A4%97-Hugging_Face_Space-informational.svg?style=flat-square">
|
||||
</a>
|
||||
<a src="https://img.shields.io/badge/%F0%9F%9A%80-SUSTech_VIP_Lab-important.svg?style=flat-square" href="https://zhengfenglab.com/">
|
||||
<img src="https://img.shields.io/badge/%F0%9F%9A%80-SUSTech_VIP_Lab-important.svg?style=flat-square">
|
||||
|
||||
@@ -64,6 +64,7 @@ class BaseInpainter:
|
||||
masks = np.stack([cv2.dilate(mask, kernel) for mask in masks], 0)
|
||||
|
||||
T, H, W = masks.shape
|
||||
masks = np.expand_dims(masks, axis=3) # expand to T, H, W, 1
|
||||
# size: (w, h)
|
||||
if ratio == 1:
|
||||
size = None
|
||||
@@ -74,10 +75,8 @@ class BaseInpainter:
|
||||
if min(size) < 50:
|
||||
ratio = 50. / min(H, W)
|
||||
size = [int(W*ratio), int(H*ratio)]
|
||||
|
||||
masks = np.expand_dims(masks, axis=3) # expand to T, H, W, 1
|
||||
binary_masks = resize_masks(masks, tuple(size))
|
||||
frames = resize_frames(frames, tuple(size)) # T, H, W, 3
|
||||
binary_masks = resize_masks(masks, tuple(size))
|
||||
frames = resize_frames(frames, tuple(size)) # T, H, W, 3
|
||||
# frames and binary_masks are numpy arrays
|
||||
|
||||
h, w = frames.shape[1:3]
|
||||
|
||||
Reference in New Issue
Block a user