cad0p/maskrcnn-modanet

Windows-10 installation

Opened this issue · 9 comments

Hi, and thank you for this awesome repo. I am trying to do things in Pytorch, so I was wondering if there is any API to just load the data in order to take from there into PyTorch.

I have manually downloaded the (50K) 2G images (used wget from the download.sh), instances_all, modanet2018_instances_train, and modanet2018_instances_val. (I guess instances_all=modanet2018_instances_train+modanet2018_instances_val)?

To my pain, I am using Windows-10 (Anaconda and its Env), and in fact I have successfully installed Keras and all other dependencies via pip install maskrcnn-modanet.

Not until I used maskrcnn-modanet datasets download my/folder where things stated back-firing, I had to run bash from the terminal, using, "c:\Program Files\Git\bin\bash.exe", and then, tried to download the images;
gg
not sure what went wrong,
Anyways, since I have the 50K images, the repo, Keras and other dependencies installed, I was wondering if there is an easy/flexible API to read the images and their corresponding masks, bboxes, and labels. Or, I would love to run it as is in Keras. To that end, I am not sure how and where can we store the data path in maskrcnn.
kk

cad0p commented

Hi, windows is not supported because the filesystem has different folder structure and many things in the code would need to be rewritten (mainly the paths using os.join instead of the hardcoded slash)

So either you fork this and make the adjustments to make it work and then we can pull your edit to add windows support, or I suggest you to get a Linux VM or computer and try it on there (or colab)

Hi @cad0p, well, I have another machine with Linux ... unfortunately this is the one available at home at the moment, and I do not want to add extra load using a VM. Now, I've managed to resolve the problem by manually creating the directories ... then, I managed to run 'arrange', 8 train, 1 validate, and 1 test (I did it wrong at the begging I thought it is 0.8, 0.1, 0.1)...

maskrcnn-keras data arrange

Anyways, the problem now seem that the setup has installed Tensorflow 2.1.0, which seems not to be compatible and is therefor causing some problems with protobuf. I perhaps need to revert back to the TF that you have used.
kiki

cad0p commented

Yes, you need to revert back to TF 1.x Unfortunately they broke many things with the new version Hopefully it will work, let me know!

It would be nice to impose installing TF 1.x in the setup.

Hi, since I could not find a workable dataloader in PyTorch, I finally managed to write one and mask-rcnn is up and running now. However, I found that some samples (out of the ~53K samples) have no annotations and had thus to exclude them from the dataset. Have you faced a similar problem? Here are the samples:

idx_with_no_annotations = [12839, 12840, 12929, 12937, 12942, 13110, 13207 ,13214 ,18866 ,
    18950 ,18978 ,18979 ,19023 ,19024 ,19062 ,19078 ,19107 ,19139 ,
    19143 ,19193 ,19197 ,19214 ,23715 ,23742 ,23755 ,23880 ,24089 ,
    24238 ,24284 ,24372 ,24483 ,24657 ,24786 ,24959 ,25094 ,25149 ,
    25300 ,25323 ,25356 ,25413 ,25426 ,25651 ,25703 ,25734 ,25777 ,
    25915 ,25940 ,26143 ,26177 ,26252 ,26285 ,26327 ,26341 ,26522 ,
    26597 ,26705 ,26802 ,26900 ,27041 ,27043 ,27087 ,27112 ,27122 ,
    27338 ,27360 ,27364 ,27384 ,27427 ,27440 ,27472 ,27542 ,27798 ,
    27800 ,27826 ,28081 ,28230 ,28503 ,28557 ,28595 ,28667 ,28669 ,
    28858 ,28899 ,29027 ,29348 ,35490 ,35539 ,35542 ,35546 ,35576 ,
    35657 ,35679 ,35711 ,35770 ,35909 ,35971 ,35989 ,36011 ,36014 ,
    36080 ,36123 ,36139 ,36149 ,36150 ,36199 ,36208 ,36211 ,36352 ,
    36361 ,36385 ,36408 ,36444 ,36456 ,36468 ,36514 ,36522 ,36570 ,
    36576 ,36592 ,36624 ,36644 ,36728 ,36754]
cad0p commented

Well, sorry if I was not clear enough, I am speaking about the samples' annotations loaded via modanet2018_instances_train.json that supposedly have annotations to all the 53K images. In the meantime, I am just throwing those samples out during __getitem__ and randomly picking another sample ... don't want to spend more time on this issue, so I just used this simple tweak:

while index in idx_with_no_annotations: 
            index = torch.randint(0, len(self.imgIds)-1, (1,)) # generarte a random index to replace that one

I don't think these annotations can be fixed, as the anns structure loaded via anns = self.coco.loadAnns(annIds) is empty.

cad0p commented
cad0p commented

Yes, you need to revert back to TF 1.x Unfortunately they broke many things with the new version Hopefully it will work, let me know!

It would be nice to impose installing TF 1.x in the setup.

Just did it! Sorry for being late