I am trying to deploy Mask RCNN to Google's Cloud ML Engine. I have managed to run the model in batch mode and collect the results of the output layers. However, ideally, I'd like to also compute the final mask as part of the job.
In other words, this part:
modelpath = model_list[0]
K.clear_session()
model = modellib.MaskRCNN(mode="inference", config=CellInferenceConfig(), model_dir=data_dir)
respath = "..path...to...cloud_output/"
resfiles = glob(respath+'prediction.results*')
resfiles = [r for r in resfiles if getsize(r)>0]
ishape = (1024, 1024, 3)
mshape = (2048, 2048, 3)
window = np.array([ 0, 0, 2048, 2048])
final_masks=[]
for resfile in resfiles:
json_data=open(resfile).read()
data = json.loads(json_data)
_, _, _, fm = model.unmold_detections(
np.asarray(data['mrcnn_detection/Reshape_1:0']),
np.asarray(data['mrcnn_mask/Reshape_1:0']),
ishape, mshape, window)
if (fm.shape[0]!=1024 or fm.shape[2]<1):
print("Image Output Size Error")
else:
final_masks.append(np.argmax(fm,2))
I wonder whether anyone managed to accomplish this or has any ideas how to achieve it?
Hi,
I am trying to deploy Mask RCNN to Google's Cloud ML Engine. I have managed to run the model in batch mode and collect the results of the output layers. However, ideally, I'd like to also compute the final mask as part of the job.
In other words, this part:
I wonder whether anyone managed to accomplish this or has any ideas how to achieve it?