solve comment three lines conflick --li

This commit is contained in:
memoryunreal
2023-04-19 11:55:02 +00:00
6 changed files with 25 additions and 8 deletions

View File

@@ -1,11 +1,25 @@
# Track-Anything # Track-Anything
**Track-Anything** is an Efficient Development Toolkit for Video Object Tracking and Segmentation, based on [Segment Anything](https://github.com/facebookresearch/segment-anything) and [XMem](https://github.com/hkchengrex/XMem).
![image](https://github.com/gaomingqi/Track-Anything/blob/master/overview.png) ***Track-Anything*** is a flexible and interactive tool for video object tracking and segmentation. It is developed upon [Segment Anything](https://github.com/facebookresearch/segment-anything), can specify anything to track and segment via user clicks only. During tracking, users can flexibly change the objects they wanna track or correct the region of interest if there are any ambiguities. These characteristics enable ***Track-Anything*** to be suitable for:
- Video object tracking and segmentation with shot changes.
- Data annnotation for video object tracking and segmentation.
- Object-centric downstream video tasks, such as video inpainting and editing.
## Demo ## Demo
https://user-images.githubusercontent.com/28050374/232322963-140b44a1-0b65-409a-b3fa-ce9f780aa40e.MP4 https://user-images.githubusercontent.com/28050374/232842703-8395af24-b13e-4b8e-aafb-e94b61e6c449.MP4
### Multiple Object Tracking and Segmentation (with [XMem](https://github.com/hkchengrex/XMem))
https://user-images.githubusercontent.com/39208339/233035206-0a151004-6461-4deb-b782-d1dbfe691493.mp4
### Video Object Tracking and Segmentation with Shot Changes (with [XMem](https://github.com/hkchengrex/XMem))
https://user-images.githubusercontent.com/30309970/232848349-f5e29e71-2ea4-4529-ac9a-94b9ca1e7055.mp4
### Video Inpainting (with [E2FGVI](https://github.com/MCG-NKU/E2FGVI))
https://user-images.githubusercontent.com/28050374/232959816-07f2826f-d267-4dda-8ae5-a5132173b8f4.mp4
## Get Started ## Get Started
#### Linux #### Linux
@@ -17,14 +31,17 @@ cd Track-Anything
# Install dependencies: # Install dependencies:
pip install -r requirements.txt pip install -r requirements.txt
# Install dependencies if using inpainting: # Install dependencies for inpainting:
pip install -U openmim pip install -U openmim
mim install mmcv mim install mmcv
# Install dependencies for editing
pip install madgrad
# Run the Track-Anything gradio demo. # Run the Track-Anything gradio demo.
python app.py --device cuda:0 --sam_model_type vit_h --port 12212 python app.py --device cuda:0 --sam_model_type vit_h --port 12212
``` ```
## Acknowledgement ## Acknowledgements
The project is based on [Segment Anything](https://github.com/facebookresearch/segment-anything) and [XMem](https://github.com/hkchengrex/XMem). Thanks for the authors for their efforts. The project is based on [Segment Anything](https://github.com/facebookresearch/segment-anything), [XMem](https://github.com/hkchengrex/XMem), and [E2FGVI](https://github.com/MCG-NKU/E2FGVI). Thanks for the authors for their efforts.

BIN
assets/demo_version_1.MP4 Normal file

Binary file not shown.

BIN
assets/inpainting.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 KiB

BIN
assets/qingming.mp4 Normal file

Binary file not shown.

View File

@@ -145,12 +145,12 @@ if __name__ == '__main__':
# ---------------------------------------------- # ----------------------------------------------
# 1/3: set checkpoint and device # 1/3: set checkpoint and device
checkpoint = '/ssd1/gaomingqi/checkpoints/E2FGVI-HQ-CVPR22.pth' checkpoint = '/ssd1/gaomingqi/checkpoints/E2FGVI-HQ-CVPR22.pth'
device = 'cuda:2' device = 'cuda:6'
# 2/3: initialise inpainter # 2/3: initialise inpainter
base_inpainter = BaseInpainter(checkpoint, device) base_inpainter = BaseInpainter(checkpoint, device)
# 3/3: inpainting (frames: numpy array, T, H, W, 3; masks: numpy array, T, H, W) # 3/3: inpainting (frames: numpy array, T, H, W, 3; masks: numpy array, T, H, W)
# ratio: (0, 1], ratio for down sample, default value is 1 # ratio: (0, 1], ratio for down sample, default value is 1
inpainted_frames = base_inpainter.inpaint(frames, masks, ratio=0.5) # numpy array, T, H, W, 3 inpainted_frames = base_inpainter.inpaint(frames, masks, ratio=1) # numpy array, T, H, W, 3
# ---------------------------------------------- # ----------------------------------------------
# end # end
# ---------------------------------------------- # ----------------------------------------------