Instructions to use MingzhenL/vessa-2d-ssl-bundle with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sam2
How to use MingzhenL/vessa-2d-ssl-bundle with sam2:
# Use SAM2 with images import torch from sam2.sam2_image_predictor import SAM2ImagePredictor predictor = SAM2ImagePredictor.from_pretrained("MingzhenL/vessa-2d-ssl-bundle") with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): predictor.set_image(<your_image>) masks, _, _ = predictor.predict(<input_prompts>)# Use SAM2 with videos import torch from sam2.sam2_video_predictor import SAM2VideoPredictor predictor = SAM2VideoPredictor.from_pretrained("MingzhenL/vessa-2d-ssl-bundle") with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): state = predictor.init_state(<your_video>) # add new prompts and instantly get the output on the same frame frame_idx, object_ids, masks = predictor.add_new_points(state, <your_prompts>) # propagate the prompts to get masklets throughout the video for frame_idx, object_ids, masks in predictor.propagate_in_video(state): ... - Notebooks
- Google Colab
- Kaggle
File size: 884 Bytes
01857e4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #!/bin/bash
#SBATCH -A p33139 ## 你的账户
#SBATCH -p gengpu ## GPU 分区
#SBATCH --gres=gpu:a100:1 ## 请求一块 A100 GPU
#SBATCH -N 1 ## 请求一个节点
#SBATCH -n 1 ## 请求一个任务
#SBATCH -t 48:00:00 ## 最大运行时间 48 小时
#SBATCH --mem=80G
#SBATCH -o logs/msd_all_tasks_%j.out
#SBATCH -e logs/msd_all_tasks_%j.err
# 加载 Conda 环境
source /projects/p32685/miniconda3/etc/profile.d/conda.sh
conda activate msd_preprocess # 激活 Conda 环境(Python 3.10+, 含所有依赖)
# 切换到脚本目录
cd /projects/p32685/VESSA_data_preprocess
# 创建日志目录
mkdir -p logs
# 运行批量处理脚本,处理所有 10 个 MSD Task
# 输入数据位置: /projects/p32685/MSD/TaskXX_*
# 输出位置: /projects/p32685/RL_dataset/MSD_taskXX/
python -u process_all_msd_tasks.py --device cuda:0
|