# visualize zero-shot inference results on custom images | |
######################################################## | |
# RegionCLIP (RN50x4) | |
python3 ./tools/train_net.py \ | |
--eval-only \ | |
--num-gpus 1 \ | |
--config-file ./configs/LVISv1-InstanceSegmentation/CLIP_fast_rcnn_R_50_C4_custom_img.yaml \ | |
MODEL.WEIGHTS ./pretrained_ckpt/regionclip/regionclip_pretrained-cc_rn50x4.pth \ | |
MODEL.CLIP.TEXT_EMB_PATH ./pretrained_ckpt/concept_emb/lvis_1203_cls_emb_rn50x4.pth \ | |
MODEL.CLIP.OFFLINE_RPN_CONFIG ./configs/LVISv1-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml \ | |
MODEL.CLIP.TEXT_EMB_DIM 640 \ | |
MODEL.RESNETS.DEPTH 200 \ | |
MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION 18 \ | |
# visualize the prediction json file | |
python ./tools/visualize_json_results.py \ | |
--input ./output/inference/lvis_instances_results.json \ | |
--output ./output/regions \ | |
--dataset lvis_v1_val_custom_img \ | |
--conf-threshold 0.05 \ | |
--show-unique-boxes \ | |
--max-boxes 25 \ | |
--small-region-px 8100\ | |
######################################################## | |
# RegionCLIP (RN50) | |
# python3 ./tools/train_net.py \ | |
# --eval-only \ | |
# --num-gpus 1 \ | |
# --config-file ./configs/LVISv1-InstanceSegmentation/CLIP_fast_rcnn_R_50_C4_custom_img.yaml \ | |
# MODEL.WEIGHTS ./pretrained_ckpt/regionclip/regionclip_pretrained-cc_rn50.pth \ | |
# MODEL.CLIP.TEXT_EMB_PATH ./pretrained_ckpt/concept_emb/lvis_1203_cls_emb.pth \ | |
# MODEL.CLIP.OFFLINE_RPN_CONFIG ./configs/LVISv1-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml \ | |
# # visualize the prediction json file | |
# python ./tools/visualize_json_results.py \ | |
# --input ./output/inference/lvis_instances_results.json \ | |
# --output ./output/regions \ | |
# --dataset lvis_v1_val_custom_img \ | |
# --conf-threshold 0.05 \ | |
# --show-unique-boxes \ | |
# --max-boxes 25 \ | |
# --small-region-px 8100\ | |