mirror of
https://github.com/gaomingqi/Track-Anything.git
synced 2025-12-16 08:27:49 +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
|
*.npy
|
||||||
images/
|
images/
|
||||||
test_sample/
|
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">
|
<img src="https://img.shields.io/badge/%F0%9F%93%96-Arxiv_2304.11968-red.svg?style=flat-square">
|
||||||
</a>
|
</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">
|
<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>
|
||||||
<a src="https://img.shields.io/badge/%F0%9F%9A%80-SUSTech_VIP_Lab-important.svg?style=flat-square" href="https://zhengfenglab.com/">
|
<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">
|
<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)
|
masks = np.stack([cv2.dilate(mask, kernel) for mask in masks], 0)
|
||||||
|
|
||||||
T, H, W = masks.shape
|
T, H, W = masks.shape
|
||||||
|
masks = np.expand_dims(masks, axis=3) # expand to T, H, W, 1
|
||||||
# size: (w, h)
|
# size: (w, h)
|
||||||
if ratio == 1:
|
if ratio == 1:
|
||||||
size = None
|
size = None
|
||||||
@@ -74,8 +75,6 @@ class BaseInpainter:
|
|||||||
if min(size) < 50:
|
if min(size) < 50:
|
||||||
ratio = 50. / min(H, W)
|
ratio = 50. / min(H, W)
|
||||||
size = [int(W*ratio), int(H*ratio)]
|
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))
|
binary_masks = resize_masks(masks, tuple(size))
|
||||||
frames = resize_frames(frames, tuple(size)) # T, H, W, 3
|
frames = resize_frames(frames, tuple(size)) # T, H, W, 3
|
||||||
# frames and binary_masks are numpy arrays
|
# frames and binary_masks are numpy arrays
|
||||||
|
|||||||
Reference in New Issue
Block a user