PRM
PRM copied to clipboard
about the "pre-computed object proposals"
hi,@ZhouYanzhao,I am confused that How to prepare the "pre-computed object proposals". Hope to receive your reply!Tks
HI @842430478 ,
The peak response mapping
module expects a list of binary masks (numpy ndarray, shape of Image Height x Image Width) as the proposal input. You can convert the output of any proposal method you like to this format to make it compatible with the retrieval algorithm. Please check the demo notebook and the paper for more details.
@ZhouYanzhao thank you for your reply.I check the demo and your paper ,I find the "pre-computed object proposals" is prepared from mcg and the number of the binary masks is 200.But I find the mcg code to generate the mask about 1000+.Could you tell me how you select the 200 masks from 1000+? hope to receive your reply!Tks
@842430478 Hi, I have the same problem as yours. Do you find any solution to sovle it?
Hi, @ZhouYanzhao. Thank you for your code. I ran the SPN code which is your another work related to object localization before. And recently I notice your new work, PRM. And I got some problem, hope you can give some suggestions. In the demo, every sample image has a json file which contains some candidate proposals. I want to know how can I transform the result of mcg proposals to json file?
@FzuLJ @842430478 I have this problem too. Have you solved this problem? Hope I can get some advice.
@842430478 @FzuLJ Which proposals method do you use? Is this https://github.com/jponttuset/mcg the mcg which you refer?
@vtddggg Yes, I use this proposals method. https://github.com/jponttuset/mcg
@FzuLJ @vtddggg I am still confused.I think the "pre-computed object proposals" is very import for this paper to obtain the mask.
@842430478 I think maybe you can select the top 200 ranked candidates from mcg as the "pre-computed object proposals". But my problem is how to convert these proposals to json format?
@FzuLJ I'm still learning it, but it seems the proposals are in RLE (Run-Length Encoding), an efficient format for storing binary masks. And the author has provided code for encoding and decoding. Hope this help!
@Yby-Bob Thank you for your advice. I succeeded getting the masks from mcg, and also converted them to json format. But my result is not as good as the paper proposed.
These are my result of samle0 and sample2. I just select candidates_mcg.masks(:,:,1:200) from mcg as pre-proposals. I am not sure the selection is correct or not.
@ZhouYanzhao Could you please give me some advice about how to select proposals?
Sorry for missing your reply, we are swamped with some project deadlines for the time being. If you need to discuss or want me to help diagnose your code, please feel free to ping me at [email protected].
@FzuLJ how did you convert them to json format? thanks! hope you reply!
@anoo6504 According to the project COB, I first saved these proposals in .mat format, then converted mat to json format.
@FzuLJ can I use COB for new dataset!? I am unable to run this for my dataset. Please help
@anoo6527 Yes, you can use COB for your dataset. I extracted my dataset proposals using COB successfully.
@FzuLJ Hello, I have the same problem in convert these proposals to json format, can you tell me what project COB is?Can you send me a link to this project?thanks! hope you reply.
@llyfzu This is the link of COB: https://github.com/kmaninis/COB
@FzuLJ Hi, I saw the COB and configured the needed MatCaffe, do I need to train my own COB caffemodel that fits my own datasets?('cause my datasets is about the guard rail on the road, not the common objects like PASCAL or BSDS500) or can I just use PASCAL caffemodel, how much could the error be? btw, do you have any advice on training my own COB caffemodel if I have to do that?
@Yby-Bob Thank you for your advice. I succeeded getting the masks from mcg, and also converted them to json format. But my result is not as good as the paper proposed.
![]()
These are my result of samle0 and sample2. I just select candidates_mcg.masks(:,:,1:200) from mcg as pre-proposals. I am not sure the selection is correct or not. @ZhouYanzhao Could you please give me some advice about how to select proposals?
Hi, @FzuLJ , what is the selection strategy of the candidates? Is the top 200 correct? Thanks.
@FzuLJ Hi, I saw the COB and configured the needed MatCaffe, do I need to train my own COB caffemodel that fits my own datasets?('cause my datasets is about the guard rail on the road, not the common objects like PASCAL or BSDS500) or can I just use PASCAL caffemodel, how much could the error be? btw, do you have any advice on training my own COB caffemodel if I have to do that?
@ylin0022 I am sorry I do not try to train the COB caffemodel cause the PASCAL just can satisfied my need. Maybe you can refer the paper of COB to get some advice.
@TinyGrass Yes, I just select the top 200 correct candidates.
@FzuLJ Thanks :)
Hi, @FzuLJ . I have another question to discuss with you. Are you familiar with the MCG algorithm? Do the pre-trained models of this algorithm need any kinds of annotated data for supervision? E.g. bounding box.
@TinyGrass I'm sorry I don't familiar with that algorithm. I think maybe you can read the paper and the corresponding codes. If they are not be clearly illustrated, maybe you can try to mail the authors for help.
@TinyGrass I'm sorry I don't familiar with that algorithm. I think maybe you can read the paper and the corresponding codes. If they are not be clearly illustrated, maybe you can try to mail the authors for help.
Thank you very much. I will try to figure it out as you say.
@ZhouYanzhao @FzuLJ can you please share the code snippet (or detailed instructions) to convert the *.mat files (from MCG/COB) to JSON format?
Did anyone get the code to convert proposals from .mat to .json? @ZhouYanzhao @FzuLJ Please help.
same problem here,
@anoo6504 According to the project COB, I first saved these proposals in .mat format, then converted mat to json format.
Hi, can you explain more on that? actually the ".mat" file is a dict that contains "superpixels", " labels", "scores", how do you generate the json file from these data, did you directly use the "superpixels" and convert it using "rle_encode" function? or are there any further processing steps?
I am looking forward to your reply.
Thanks,
Could anyone kindly offer the json.format object proposals of the PASCAL VOC 2012 dataset? Many thanks!
https://github.com/jponttuset/mcg/blob/master/pre-trained/demos/demo_im2mcg.m
Hi, I wrote a matlab code for the object proposals.
Below code can run on the demo_im2mcg.m file (make sure you run install.m first)
This code will create a (H,W,D) array, where D=id=500 is the top D object proposals. And it will save the array into .mat format. Load it into python and is use as proposals_cob
Hope it helps 😀
%%
imagefiles = dir('*.jpg');
nfiles = length(imagefiles); % Number of files found
for ii=1:nfiles
currentfilename = imagefiles(ii).name;
currentimage = imread(currentfilename);
[candidates_mcg, ucm2_mcg] = im2mcg(currentimage,'accurate');
output = [];
for id = 1:500
mask1 = ismember(candidates_mcg.superpixels, candidates_mcg.labels{id});
output = cat(3,output,mask1);
end
saveName=strcat(imagefiles(ii).name, '.mat');
save(saveName, 'output');
end