Mask_rcnn: Detection Time (Question)

Created on 17 Sep 2018  路  4Comments  路  Source: matterport/Mask_RCNN

Hey,

When I run Detection from balloon_model on average it takes 25 sec. Why is it so slow? Because of my PC?

P.S
I don't want to spam this repo with stupid questions. I will delete this one in a day or two :)

image_id = random.choice(dataset.image_ids)
image, image_meta, gt_class_id, gt_bbox, gt_mask =\
    modellib.load_image_gt(dataset, config, image_id, use_mini_mask=False)
info = dataset.image_info[image_id]
print("image ID: {}.{} ({}) {}".format(info["source"], info["id"], image_id, 
                                       dataset.image_reference(image_id)))

# Run object detection
results = model.detect([image], verbose=1)

# Display results
ax = get_ax(1)
r = results[0]
visualize.display_instances(image, r['rois'], r['masks'], r['class_ids'], 
                            dataset.class_names, r['scores'], ax=ax,
                            title="Predictions")
log("gt_class_id", gt_class_id)
log("gt_bbox", gt_bbox)
log("gt_mask", gt_mask)

Most helpful comment

Sure, I will close it.
To clarify my question... I'm not saying about training time. I have trained model on cloud and with created model I want to test model with validation images on my i3 PC and for 1 image it takes 25 sec to detect my custom object in the image. Is that normal?

Thanks

All 4 comments

Probably, 25sec sounds normal for an average PC without GPU. You need a machine with a NVIDIA GPU to speed that up by a lot; with a GTX1080Ti it shound run in under a second per step.

Your question is not Mask-RCNN specific, I suggest you close it and look into running Tensorflow on a GPU.

Sure, I will close it.
To clarify my question... I'm not saying about training time. I have trained model on cloud and with created model I want to test model with validation images on my i3 PC and for 1 image it takes 25 sec to detect my custom object in the image. Is that normal?

Thanks

Ah no, inference should be much faster. But loading an image could be slow if it's large maybe. You probably should do a bit of profiling to measure where the time is actually spent.

Probably, 25sec sounds normal for an average PC without GPU. You need a machine with a NVIDIA GPU to speed that up by a lot; with a GTX1080Ti it shound run in under a second per step.

Your question is not Mask-RCNN specific, I suggest you close it and look into running Tensorflow on a GPU.

the 'step' u mentioned here means per picture?

Was this page helpful?
0 / 5 - 0 ratings