Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot use pre-trained file cannot be used in matterport/Mask-RCNN #4

Open
hideoshiraishi opened this issue Jun 18, 2021 · 2 comments

Comments

@hideoshiraishi
Copy link

It would be appreciated if someone clarify how to implement building detection using pre-trained file and matterport's Mask-RCNN.

Before getting into the building detection, I could run "demo.ipynb" in "sample" folder in matterport's repository and detect objects using some my own images.

Now, I am trying to change the original pre-trained file (mask_rcnn_coco.h5) to yours (mask_rcnn_spacenet_0151.h5) to detect buildings from satellite images.

Here I attached the demo_building.ipynb which I slightly modified to load your pre-trained model.
The changes are really limited:

demo_building.txt
As .ipynb file was not accepted, please change the extension from .txt to .ipynb.

Changing pre-trained file
1

As I am not sure of the class_names in the replaced pre-trained file, currently I just commented out class_names.
Perhaps it may require some updates but I have no idea on this.
2

However, as a result, an error occurs when I run the following script as attached in the file error.txt.
3

error.txt

It would be highly appreciated if you could suggest any corrections to run the model and detect the footprints appropriately. As I am quite new in this field, please forgive me if I miss some basics.

Thank you in advance for your support.

@hideoshiraishi
Copy link
Author

I have not solved the issue completely but I could run the model by changing the class name setting as below:

class_names = ['BG', 'building']

The building detection seems to be implemented somehow with baseline pre-trained file. I will look into it more detail to apply the file from your repository. Thank you!

@Mstfakts
Copy link
Owner

Hello Hideo,

The error is about the shape mismatch for the last layer. It's bc there are only 2 classes in the project, these are the background and the building. If you want to change the output layers, try freezing the layers except the last one.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants