Tensorflow Object Detection API - How do I implement Mask R-CNN via this? - tensorflow

I notice in the code for the Tensorflow Object Detection API there are several references to Mask R-CNN however no mention of it in the documentation. Is it possible to train/run Mask R-CNN through this API, and if so how?

You may not like it, but the answer is (for the moment), is no. The API cannot be used to predict or recover masks
They only use a little part of the Mask R-CNN paper to predict boxes in a certain way, but predicting the instance masks is not yet implemented.

Now we can implement Mask with faster_rcnn_inception_v2 there is samples with 1.8.0 tensorflow version

Related

Understanding exactly what the pretrained model does on the Tensorflow object detection API

I am trying to understand what I need from any pre-trained model used in the API regardless of any additional code found on the Tensorflow object detection API.
For example: ssd_mobilenet_v1_coco_2017_11_17, depending on what I have understood: it is a model that is already trained to detect objects (there is a classification to know the category of the object + Regression to bound the objects with rectangles and those rectangles are actually the x,y,w,h coordinates on the object).
How do we benefit from the regression output of that model (x,y,w,h coordinates) to use them in another model?
Let's assume we want to print out just the coordinates x,y,w,h of a detected object on an image without any need of the code of Tensorflow object detection API, how can we do that?
Certainly you can use the pretrained model provided in tensorflow object detection model zoo without installing object detection api. The alternative solution is to use opencv.
Opencv has provided both c++ and python api to call .pb models generated by tensorflow. Here is a nice tutorial.

Custom implementation of NMS in pure tensorflow (Using Fasterrcnn for point detection)

Context of the Problem Trying to Solve:
I am using FasterRcnn to detect key points. And I am stuck at the implementation of custom NMS in tensorflow. I can't use tensorflow's NMS as it is for bounding boxes and I want to implement it for keypoint detection based on Euclidean distance as a parameter.
I saw view github repos were they implemented custom NMS but in caffe not tensorflow:
https://github.com/msracver/Deformable-ConvNets
https://github.com/kevinjliang/tf-Faster-RCNN
So my question: is it possible to implement custom NMS for proposals from rpn layer to rcnn layer in pure tensorflow?
I want to write the whole NMS operation in tensorflow, the point where I am stuck at is accessing the individual index for NMS logic without sess.run().
PS: I don't know CUDA programming, to edit .cu files mentioned in the above repos.
Let me know if more details are needed.

Customize MobileNet model architecture with Tensorflow Object Detection API

Tensorflow object detection API provides a number of pretrained object detection models to choose from. However, I would like to introduce modifications to the architecture of those models.
Particularly, I would like to make Faster RCNN into a more shallow network and use it to train my model. I want to gain in performance despite loss in accuracy. MobileNet is too inaccurate for my application.
Is it possible to achieve this without having to implement everything from scratch ?
Thank you.

Faster RCNN for TensorFlow

Has anyone implement the FRCNN for TensorFlow version?
I found some related repos as following:
Implement roi pool layer
Implement fast RCNN based on py-faster-rcnn repo
but for 1: assume the roi pooling layer works (I haven't tried), and there are something need to be implemented as following:
ROI data layer e.g. roidb.
Linear Regression e.g. SmoothL1Loss
ROI pool layer post-processing for end-to-end training which should convert the ROI pooling layer's results to feed into CNN for classifier.
For 2: em...., it seems based on py-faster-rcnn which based on Caffe to prepared pre-processing (e.g. roidb) and feed data into Tensorflow to train the model, it seems weird, so I may not tried it.
So what I want to know is that, will Tensorflow support Faster RCNN in the future?. If not, do I have any mis-understand which mentioned above? or has any repo or someone support that?
Tensorflow has just released an official Object Detection API here, that can be used for instance with their various slim models.
This API contains implementation of various Pipelines for Object Detection, including popular Faster RCNN, with their pre-trained models as well.

Upsampling feature maps in TensorFlow

I want to implement a convolution-deconvolution network for a image segmentation project. In the deconvolution part, I am planning to upsample the feature map by 2. e.g. The original feature map is of dimension 64*64*4 and I want to upsample it into 128*128*4. Does anyone know a tensor operation that does this? Thanks!
You could use tf.image.resize_images(). It takes batches of images or single images and supports the most common methods such as bilinear and nearest_neighbor.
Here's the link to the TensorFlow API reference: resizing
You can also take a look at how the upsampling operation is implemented in a higher-level API such as tflearn. You can find upsample_2d and upscore_layer in their Github repo: conv.py
Note: the output might be cast to tf.float32 in older TF versions