ssanishk / Insulator-Detection-from-Aerial-Images

A study project which uses Faster-RCNN architecture to detect an insulator from aerial Images captured by UAVs.
13 stars 6 forks source link

Can't predict insulators after training 600 images #1

Open lbj96347 opened 4 years ago

lbj96347 commented 4 years ago

My Requirements

And I also use Resnet-50 to train data. I put all code on Google Colab for testing.

Issues in config.py

on line 56

# self.model_path = 'model_trained/model_frcnn.vgg.hdf5'

When I just run with the original config.py , logs will notice can't locate attribute: 'weight_names'. So I downloaded resnet50_weights_th_dim_ordering_th_kernels_notop.h5 and configured it.

self.model_path = '../../model/resnet50_weights_th_dim_ordering_th_kernels_notop.h5'

python3 predict.py but no bounding boxes came out

...
Epoch 48/50
 56/100 [===============>..............] - ETA: 49s - rpn_cls: 0.3278 - rpn_regr: 0.2890 - detector_cls: 0.1658 - detector_regr: 0.2395Average number of overlapping bounding boxes from RPN = 2.13 for 100 previous iterations
100/100 [==============================] - 113s - rpn_cls: 0.2994 - rpn_regr: 0.3020 - detector_cls: 0.1755 - detector_regr: 0.2177   
Mean number of bounding boxes from RPN overlapping ground truth boxes: 2.3
Classifier accuracy for bounding boxes from RPN: 0.9296875
Loss RPN classifier: 0.2675136430445127
Loss RPN regression: 0.3089080382883549
Loss Detector classifier: 0.19544762402656488
Loss Detector regression: 0.1934243429452181
Elapsed time: 113.08834338188171
Total loss decreased from 1.0360624336451292 to 0.9652936483046506, saving weights
Epoch 49/50
 56/100 [===============>..............] - ETA: 48s - rpn_cls: 0.3397 - rpn_regr: 0.3013 - detector_cls: 0.2367 - detector_regr: 0.2747Average number of overlapping bounding boxes from RPN = 2.63 for 100 previous iterations
100/100 [==============================] - 111s - rpn_cls: 0.3342 - rpn_regr: 0.3099 - detector_cls: 0.2281 - detector_regr: 0.2633   
Mean number of bounding boxes from RPN overlapping ground truth boxes: 2.59
Classifier accuracy for bounding boxes from RPN: 0.918125
Loss RPN classifier: 0.33799080304335805
Loss RPN regression: 0.32911228962242606
Loss Detector classifier: 0.21419535760913277
Loss Detector regression: 0.24265226289629938
Elapsed time: 113.65861868858337
Epoch 50/50
 56/100 [===============>..............] - ETA: 48s - rpn_cls: 0.2771 - rpn_regr: 0.2613 - detector_cls: 0.2131 - detector_regr: 0.2364Average number of overlapping bounding boxes from RPN = 2.61 for 100 previous iterations
100/100 [==============================] - 111s - rpn_cls: 0.2673 - rpn_regr: 0.2686 - detector_cls: 0.2194 - detector_regr: 0.2296   
Mean number of bounding boxes from RPN overlapping ground truth boxes: 2.45
Classifier accuracy for bounding boxes from RPN: 0.920625
Loss RPN classifier: 0.27573819690413076
Loss RPN regression: 0.288351833303459
Loss Detector classifier: 0.2192873611766845
Loss Detector regression: 0.22204179219901563
Elapsed time: 111.5955023765564
Training complete, exiting.

After waiting 1.5 hours, I tried to run

python3 predict.py

all the result images are without boudning boxes, it looks like prediction is failed. I can't figure out which step is fault.

lbj96347 commented 4 years ago

It seems like related to the epoch setting in config.py. I changed epoch value from 50 to 150:

self.num_epochs = 150

Then I train it again. The output result is good as the paper said.