Code Monkey home page Code Monkey logo

building-detection-maskrcnn's Introduction

Hi there, I'm Mustafa Aktaş 👋

  • ⚡ Passionate about Software Development and Artificial Intelligence, I am a seasoned Python (and little C++/C) developer with a strong foundation in Design Patterns, DevOps practices and ML/DL/Computer Vision background. My expertise spans across a wide range of technical domains, including Data Science, Computer Vision, Digital Twins and IoT. I am committed to innovation, continuous learning, and the end-to-end development of Software projects, so that, I still continue my MSc. life at Istanbul Technical University in Computer Science Department.

  • 🔭 Interested in the fields of machine learning, deep learning, computer vision, remote sensing, big data, data analysis, etc. Also, I completed many projects in those fields (check my repositories or let me send my CV).

  • 📫 If you want to collaborate on a project or reach me out, email me at [email protected] or do not hesitate to connect on LinkedIn



building-detection-maskrcnn's People

Contributors

mstfakts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

building-detection-maskrcnn's Issues

Hocam Yardımınıza ihtiyacım var

Hocam merhabalar.Google Colab'da Yapı algılama modeli oluşturmak istiyorum ama veri boyutu nedeniyle yol alamıyorum bilgisayarıma Mask RCNN kuramıyorum gereksinimleri karşılamıyo ne yapabilirim

Train Dataset and panSharpen1

hello Sir. Can you post the necessary files to run the application? also the python file where you created your model? I need to be able to get results like; F1 Score, Validation date, binary_accuracy, loss

How to rename the file

  1. What are the total files that need to be renamed?
  2. What are the rules for renaming? Can you give an example of how to rename it? (I followed the rules of RGB-PanSharpen_AOI_2_Vegas_imgg1.tif, RGB-PanSharpen_AOI_2_Vegas_imgg2.tif..... and buildings_AOI_2_Vegas_imgg1.geojson. When the buildings_AOI_2_Vegas_imgg2.geojson is extracted, there will be an error that does not match the actual mask.
  3. Is the file extracted by create_mask.py useful? I see that the mask image is not used in SpacenetTrain.py.
    Thank you for your help!
    The following is the interface output by train.py after I renamed it according to my method
    1
    2

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

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.

There is a problem that mAP is always calculated as 0.0.

I ran the SpaceNet_train.py file using the weights file you provided. (The learning step is omitted.)
However, unlike the code, random images are not displayed, and mAP is always calculated as 0.0.
Actually, I'm a beginner who just studied deep learning, so I can't figure out which part is wrong.
I am attaching the file(convert txt to py) I ran, so please tell me where the problem is.
Thank you always.

Configurations:
BACKBONE resnet50
BACKBONE_STRIDES [4, 8, 16, 32, 64]
BATCH_SIZE 1
BBOX_STD_DEV [0.1 0.1 0.2 0.2]
COMPUTE_BACKBONE_SHAPE None
DETECTION_MAX_INSTANCES 350
DETECTION_MIN_CONFIDENCE 0.7
DETECTION_NMS_THRESHOLD 0.3
FPN_CLASSIF_FC_LAYERS_SIZE 1024
GPU_COUNT 1
GRADIENT_CLIP_NORM 5.0
IMAGES_PER_GPU 1
IMAGE_CHANNEL_COUNT 3
IMAGE_MAX_DIM 640
IMAGE_META_SIZE 14
IMAGE_MIN_DIM 640
IMAGE_MIN_SCALE 0
IMAGE_RESIZE_MODE square
IMAGE_SHAPE [640 640 3]
LEARNING_MOMENTUM 0.9
LEARNING_RATE 0.001
LOSS_WEIGHTS {'rpn_class_loss': 1.0, 'rpn_bbox_loss': 1.0, 'mrcnn_class_loss': 1.0, 'mrcnn_bbox_loss': 1.0, 'mrcnn_mask_loss': 1.0}
MASK_POOL_SIZE 14
MASK_SHAPE [28, 28]
MAX_GT_INSTANCES 250
MEAN_PIXEL [123.7 116.8 103.9]
MINI_MASK_SHAPE (56, 56)
NAME SpaceNet
NUM_CLASSES 2
POOL_SIZE 7
POST_NMS_ROIS_INFERENCE 1000
POST_NMS_ROIS_TRAINING 2000
PRE_NMS_LIMIT 6000
ROI_POSITIVE_RATIO 0.33
RPN_ANCHOR_RATIOS [0.25, 1, 4]
RPN_ANCHOR_SCALES (8, 16, 32, 64, 128)
RPN_ANCHOR_STRIDE 1
RPN_BBOX_STD_DEV [0.1 0.1 0.2 0.2]
RPN_NMS_THRESHOLD 0.7
RPN_TRAIN_ANCHORS_PER_IMAGE 256
STEPS_PER_EPOCH 500
TOP_DOWN_PYRAMID_SIZE 256
TRAIN_BN False
TRAIN_ROIS_PER_IMAGE 32
USE_MINI_MASK True
USE_RPN_ROIS True
VALIDATION_STEPS 50
WEIGHT_DECAY 0.0001

1165
C:\Users\Seo\anaconda3\envs\mrcnn\lib\site-packages\mask_rcnn-2.1-py3.6.egg\mrcnn\visualize.py:56: UserWarning:

Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.

1336
788
737
WARNING:tensorflow:From C:\Users\Seo\anaconda3\envs\mrcnn\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be
removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From C:\Users\Seo\anaconda3\envs\mrcnn\lib\site-packages\keras\backend\tensorflow_backend.py:1154: calling reduce_max_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecate
d and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From C:\Users\Seo\anaconda3\envs\mrcnn\lib\site-packages\keras\backend\tensorflow_backend.py:1188: calling reduce_sum_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecate
d and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From C:\Users\Seo\anaconda3\envs\mrcnn\lib\site-packages\mask_rcnn-2.1-py3.6.egg\mrcnn\model.py:772: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a
future version.
Instructions for updating:
Use tf.cast instead.
Loading weights from D:\mask_rcnn_spacenet_0151.h5
2021-11-09 01:06:42.125108: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2021-11-09 01:06:42.267542: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties:
name: GeForce RTX 3060 Ti major: 8 minor: 6 memoryClockRate(GHz): 1.695
pciBusID: 0000:01:00.0
totalMemory: 8.00GiB freeMemory: 6.99GiB
2021-11-09 01:06:42.268127: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2021-11-09 01:10:02.188573: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-11-09 01:10:02.188862: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0
2021-11-09 01:10:02.189157: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N
2021-11-09 01:10:02.189519: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6714 MB memory) -> physical GPU (device: 0,
name: GeForce RTX 3060 Ti, pci bus id: 0000:01:00.0, compute capability: 8.6)
original_image shape: (640, 640, 3) min: 6.00000 max: 250.00000 uint8
image_meta shape: (14,) min: 0.00000 max: 650.00000 float64
gt_class_id shape: (0,) min: max: int32
gt_bbox shape: (0, 4) min: max: int32
gt_mask shape: (640, 640, 0) min: max: bool

*** No instances to display ***

C:\Users\Seo\anaconda3\envs\mrcnn\lib\site-packages\mask_rcnn-2.1-py3.6.egg\mrcnn\visualize.py:167: UserWarning:

Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.

Processing 1 images
image shape: (640, 640, 3) min: 6.00000 max: 250.00000 uint8
molded_images shape: (1, 640, 640, 3) min: -117.70000 max: 133.20000 float64
image_metas shape: (1, 14) min: 0.00000 max: 640.00000 int32
anchors shape: (1, 102300, 4) min: -0.20031 max: 1.10016 float32
2021-11-09 01:10:04.638200: I tensorflow/stream_executor/dso_loader.cc:152] successfully opened CUDA library cublas64_100.dll locally

*** No instances to display ***

mAP: 0.
SpaceNet_train_modified.txt
0

Need help to load the Pre-trained Model

Hello,

Trying your code from here: https://github.com/Mstfakts/Building-Detection-MaskRCNN for one of my Engineering-final-year project. I downloaded the pre-trained model from here: https://drive.google.com/file/d/1X-vodJEXvnu6uEn0TDLt1VhHkT17eOkG/view

I am trying to load the model like I have done for 'Image Classifier using CNN' project, where I loaded the model (keras.model.load_model), then loaded the test image (keras.preprocessing.image.load_img), then made the model predict ( keras.model.load_model .predict), then displayed the prediction.

Trying the above process for your code gives an error as follows:


runfile('D:/python/building_detection/7_Building-Detection-MaskRCNN-master/load_model.py', wdir='D:/python/building_detection/7_Building-Detection-MaskRCNN-master')
Traceback (most recent call last):

File "D:\python\building_detection\7_Building-Detection-MaskRCNN-master\load_model.py", line 6, in
loaded_model=load_model('D:/python/building_detection/7_Building-Detection-MaskRCNN-master/Building-Detection.h5')

File "C:\Users\rajak\anaconda3\envs\mrcnn_building\lib\site-packages\keras\engine\saving.py", line 492, in load_wrapper
return load_function(*args, **kwargs)

File "C:\Users\rajak\anaconda3\envs\mrcnn_building\lib\site-packages\keras\engine\saving.py", line 584, in load_model
model = _deserialize_model(h5dict, custom_objects, compile)

File "C:\Users\rajak\anaconda3\envs\mrcnn_building\lib\site-packages\keras\engine\saving.py", line 270, in _deserialize_model
model_config = h5dict['model_config']

File "C:\Users\rajak\anaconda3\envs\mrcnn_building\lib\site-packages\keras\utils\io_utils.py", line 318, in getitem
raise ValueError('Cannot create group in read-only mode.')

ValueError: Cannot create group in read-only mode.


Could you please help me with using the pre-trained model and detect the building-footprints from a given test image? Please share a sample code for the same.

Awaiting your response.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.