facebookresearch / vlpart Goto Github PK
View Code? Open in Web Editor NEW[ICCV2023] VLPart: Going Denser with Open-Vocabulary Part Segmentation
License: MIT License
[ICCV2023] VLPart: Going Denser with Open-Vocabulary Part Segmentation
License: MIT License
Hello!
Thank you for this great work! I was wondering if there's an easy way that I'm missing to dynamically change the custom vocabulary per sample? Or is this a limitation of detectron2 (i.e., not being able to change Metadata)?
Hi @PeizeSun @ShoufaChen et al.,
Thx for ur great contribution. When I tried the demo on the image below, with the cmd:
python demo/demo.py --config-file configs/partimagenet_ablation/r50_lvis_paco_pascalpart_ins11_ins11parsed.yaml \
--input input1.jpg \
--output output_image \
--vocabulary pascal_part \
--confidence-threshold 0.7 \
--opts MODEL.WEIGHTS models/r50_lvis_paco_pascalpart_ins11_ins11parsed.pth VIS.BOX False
I cannot get satisfactory generalization results: e.g., misclassify the leg as the arm. Could you provide some guidance on this issue? Many thx & rgds,
Hi, I found this part of the code confusing. Could you give some explanations? I put some comments that I didn't understand. Thanks.
for ann in data['annotations']:
segs = ann['segmentation']
new_segs = []
for seg in segs:
assert len(seg) > 0 and len(seg) % 2 == 0
if len(seg) < 4:
new_segs.append(seg + [0, 0, seg[0], seg[1]]) # why do you add these?
if len(seg) == 4:
new_segs.append(seg + [seg[0], seg[1]])
else:
new_segs.append(seg)
new_segs.append(seg) # Why do we need this line?
ann['segmentation'] = new_segs
The blog post linked for demo page directs to detectron2 blog page - https://github.com/facebookresearch/VLPart/tree/main/demo
instead of - https://cheems-seminar.github.io/
Hi! Thank you very much for your excellent work!
How can I export the alpha mask of the segmented area? That is, a black and white image that only leaves the segmented area white?
Thank you very much in advance!
Hi, I appreciate your great work, however, when I run evaluation on PACO dataset follow your instructions, I found out that both r_50 and swinbase model reach a higher AP than your paper on open-vocabulary task, the details are as follows:
r_50:
AP | AP50 | AP75 | APs | APm | APl | APr | APc | APf | post-processed |
---|---|---|---|---|---|---|---|---|---|
18.477 | 34.633 | 17.761 | 16.062 | 29.749 | 32.301 | 8.750 | 15.564 | 19.478 | {'obj-AP': 31.371, 'obj-AP50': 53.012, 'obj-part-AP-heirarchical': 14.587, 'obj-part-AP50-heirarchical': 29.521} |
AP | AP50 | AP75 | APs | APm | APl | APr | APc | APf | post-processed |
---|---|---|---|---|---|---|---|---|---|
13.323 | 25.231 | 12.589 | 10.641 | 22.601 | 26.665 | 7.500 | 12.214 | 13.716 | {'obj-AP': 27.955, 'obj-AP50': 46.029, 'obj-part-AP-heirarchical': 10.762, 'obj-part-AP50-heirarchical': 21.421} |
Swinbase:
AP | AP50 | AP75 | APs | APm | APl | APr | APc | APf | post-processed |
---|---|---|---|---|---|---|---|---|---|
27.089 | 44.215 | 27.583 | 23.176 | 43.016 | 50.203 | 7.500 | 22.097 | 28.820 | {'obj-AP': 45.284, 'obj-AP50': 62.063, 'obj-part-AP-heirarchical': 21.636, 'obj-part-AP50-heirarchical': 38.498} |
AP | AP50 | AP75 | APs | APm | APl | APr | APc | APf | post-processed |
---|---|---|---|---|---|---|---|---|---|
19.103 | 34.669 | 18.116 | 15.740 | 30.578 | 37.538 | 2.500 | 16.957 | 19.892 | {'obj-AP': 37.66, 'obj-AP50': 56.677, 'obj-part-AP-heirarchical': 15.208, 'obj-part-AP50-heirarchical': 29.44} |
and my evaluation command is:
python train_net.py --config-file configs/paco/r50_paco.yaml --eval-only --num-gpus 8
and:
python train_net.py --config-file configs/paco/swinbase_cascade_paco.yaml --eval-only --num-gpus 8
Could you please check your result or inform me that how should I reproduce your result, thanks!
I ran the demo on vocabulary 'lvis-paco' with the command:
python demo/demo.py --config-file configs/joint_in/swinbase_cascade_lvis_paco_pascalpart_partimagenet_inparsed.yaml
--input input1.jpg input2.jpg input3.jpg
--output output_image
--vocabulary lvis_paco
--confidence-threshold 0.7
--opts MODEL.WEIGHTS models/swinbase_cascade_lvis_paco_pascalpart_partimagenet_inparsed.pth VIS.BOX False
then it printed 'Killed' and exited. I switched it to gpu, then it came out with the error:
Traceback (most recent call last):
File "/workspace/VLPart/demo/demo.py", line 116, in
demo = VisualizationDemo(cfg, args).to("cuda:0")
File "/workspace/VLPart/demo/predictor.py", line 124, in init
classifier = get_clip_embeddings(self.metadata.thing_classes)
File "/workspace/VLPart/demo/predictor.py", line 30, in get_clip_embeddings
emb = text_encoder(texts).detach().permute(1, 0).contiguous()
File "/root/miniconda3/envs/3s/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/workspace/VLPart/./vlpart/modeling/text_encoder/text_encoder.py", line 166, in forward
features = self.encode_text(text) # B x D
File "/workspace/VLPart/./vlpart/modeling/text_encoder/text_encoder.py", line 154, in encode_text
x = self.transformer(x)
File "/root/miniconda3/envs/3s/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/workspace/VLPart/./vlpart/modeling/text_encoder/text_encoder.py", line 61, in forward
return self.resblocks(x)
File "/root/miniconda3/envs/3s/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/miniconda3/envs/3s/lib/python3.10/site-packages/torch/nn/modules/container.py", line 217, in forward
input = module(input)
File "/root/miniconda3/envs/3s/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/workspace/VLPart/./vlpart/modeling/text_encoder/text_encoder.py", line 46, in forward
x = x + self.attention(self.ln_1(x))
File "/workspace/VLPart/./vlpart/modeling/text_encoder/text_encoder.py", line 43, in attention
return self.attn(x, x, x, need_weights=False, attn_mask=self.attn_mask)[0]
File "/root/miniconda3/envs/3s/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/miniconda3/envs/3s/lib/python3.10/site-packages/torch/nn/modules/activation.py", line 1205, in forward
attn_output, attn_output_weights = F.multi_head_attention_forward(
File "/root/miniconda3/envs/3s/lib/python3.10/site-packages/torch/nn/functional.py", line 5224, in multi_head_attention_forward
q, k, v = _in_projection_packed(query, key, value, in_proj_weight, in_proj_bias)
File "/root/miniconda3/envs/3s/lib/python3.10/site-packages/torch/nn/functional.py", line 4767, in _in_projection_packed
proj = proj.unflatten(-1, (3, E)).unsqueeze(0).transpose(0, -2).squeeze(-2).contiguous()
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 750.00 MiB (GPU 0; 31.74 GiB total capacity; 29.76 GiB already allocated; 724.12 MiB free; 30.04 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
My GPU has 40GB memory. I want to know on what condition I can run the demo on vocabulary 'lvis-paco'
thanks for your excellent work,i'm new to deep learning,
how to visualize the results of paco dataset, i used the swinbase_cascade_paco.yaml model and the checkpoints to train,but how to visualize the obtained json file? thanks a lot
Hello!
I am trying to reproduce the pascal part results when going from base to novel categories and am experiencing different results from saving my own weights vs. using the ones you have provided in datasets/metadata
.
For example, when using the saved weights you provide these are my results after 2000 iterations (1 gpu).
And these are my results after saving new weights using tools/pascal_part_base_clip_name.py
.
The only difference seems to be in the precision between these weights (in the 1e-4 place
). Do you know why there would be such a discrepancy?
Thank you!
Josh
Thanks for the great work! I'm hoping to test VLPart for detecting objects from aerial images. However, The results are not as expected. Could you please help me? I wasn't sure if I was using the repo incorrectly or if this was the limitation of the released model on the aerial image. Thank you in advance for your help!
Here is a result I got by running :
python demo/demo.py --config-file configs/joint_in/swinbase_cascade_lvis_paco_pascalpart_partimagenet_inparsed.yaml --input 2.jpg --output output_image --vocabulary custom --custom_vocabulary "road,building,window,tree,car,light pole" --confidence-threshold 0.7 --opts MODEL.WEIGHTS models/swinbase_cascade_lvis_paco_pascalpart_partimagenet_inparsed.pth VIS.BOX False
I also tried to lower the confidence-threshold, but other than the cars, nothing was detected.
作者您好!数据集下载中的 COCO and LVIS 部分的 “Download lvis_v1_minival_inserted_image_name.json from”
链接失效,请更新下,谢谢!
First thank you for your great work!!
The model outputs several overlapped regions with a same label when a picture which doesn't belong to any dataset was input. I wonder why this happend and how to fix it?
Thank you in advance!
Hi, I very appreciate your work and I would like to follow your work and apply it to recent tasks, but I wonder how could I visualize these image-level data that were parsed into part-level data, I found out that in configs folder there is another folder named ann_parser which contains the config file to parse data. However, when I use the config file "find_ins_mixer.yaml" it went wrong with "FileNotFoundError: [Errno 2] No such file or directory: 'output_basedata_pascalpart' ", I would like to know that what command should I run and how should I prepare datasets for visualizing those images that were parsed into part-level data, thanks.
Hello!
What weight are you saving for the zero shot weights?
Thank you for this great work! When I run your scripts to generate the annotations for pascal part I only get 8831 total samples as opposed to the expected ~10,000. Do you know why this would be?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.