aten_model.py
def detect(self, images, key1s, key2s, key3s, identity_ind):
        """Runs the detection pipeline.

        images: List of images, potentially of different sizes.

        Returns a list of dicts, one dict per image. The dict contains:
        rois: [N, (y1, x1, y2, x2)] detection bounding boxes
        class_ids: [N] int class IDs
        scores: [N] float probability scores for the class IDs
        masks: [H, W, N] instance binary masks
        """
        assert len(images) == len(identity_ind
            ) == self.config.BATCH_SIZE, "len(images) must be equal to BATCH_SIZE"

        # Mold inputs to format expected by the neural network
        molded_images, image_metas, windows = self.mold_inputs(images)
        molded_key1s, _, _ = self.mold_inputs(key1s)
        molded_key2s, _, _ = self.mold_inputs(key2s)
        molded_key3s, _, _ = self.mold_inputs(key3s)
        identity_ind = np.stack(identity_ind)

        # Run object detection
        detections, mrcnn_class, mrcnn_bbox, mrcnn_mask, \
            rois, rpn_class, rpn_bbox, mrcnn_global_parsing_prob =\
            self.keras_model.predict([molded_images, molded_key1s, molded_key2s, molded_key3s, 
                identity_ind, image_metas], verbose=0)
        # Process detections
        results = []
        for i, image in enumerate(images):
            final_rois, final_class_ids, final_scores, final_masks, final_globals =\
                self.unmold_detections(detections[i], mrcnn_mask[i], mrcnn_global_parsing_prob[i], 
                                       image.shape, windows[i])
            results.append({
                "rois": final_rois,
                "class_ids": final_class_ids,
                "scores": final_scores,
                "masks": final_masks,
                "global_parsing": final_globals
            })
        return results
Runs the detection pipeline.

        images: List of images, potentially of different sizes.

        Returns a list of dicts, one dict per image. The dict contains:
        rois: [N, (y1, x1, y2, x2)] detection bounding boxes
        class_ids: [N] int class IDs
        scores: [N] float probability scores for the class IDs
        masks: [H, W, N] instance binary masks
        
Runs the detection pipeline.
images: List of images, potentially of different sizes.

Returns a list of dicts, one dict per image.
Runs the detection pipeline . images : List of images potentially of different sizes . Returns a list of dicts one dict per image .
def detect(self, images, key1s, key2s, key3s, identity_ind):
        assert len(images) == len(identity_ind
            ) == self.config.BATCH_SIZE, "len(images) must be equal to BATCH_SIZE"
        molded_images, image_metas, windows = self.mold_inputs(images)
        molded_key1s, _, _ = self.mold_inputs(key1s)
        molded_key2s, _, _ = self.mold_inputs(key2s)
        molded_key3s, _, _ = self.mold_inputs(key3s)
        identity_ind = np.stack(identity_ind)
        detections, mrcnn_class, mrcnn_bbox, mrcnn_mask, \
            rois, rpn_class, rpn_bbox, mrcnn_global_parsing_prob =\
            self.keras_model.predict([molded_images, molded_key1s, molded_key2s, molded_key3s, 
                identity_ind, image_metas], verbose=0)
        results = []
        for i, image in enumerate(images):
            final_rois, final_class_ids, final_scores, final_masks, final_globals =\
                self.unmold_detections(detections[i], mrcnn_mask[i], mrcnn_global_parsing_prob[i], 
                                       image.shape, windows[i])
            results.append({
                "rois": final_rois,
                "class_ids": final_class_ids,
                "scores": final_scores,
                "masks": final_masks,
                "global_parsing": final_globals
            })
        return results
def detect ( self , images , key1s , key2s , key3s , identity_ind ) : assert len ( images ) == len ( identity_ind ) == self . config . BATCH_SIZE , "len(images) must be equal to BATCH_SIZE" molded_images , image_metas , windows = self . mold_inputs ( images ) molded_key1s , _ , _ = self . mold_inputs ( key1s ) molded_key2s , _ , _ = self . mold_inputs ( key2s ) molded_key3s , _ , _ = self . mold_inputs ( key3s ) identity_ind = np . stack ( identity_ind ) detections , mrcnn_class , mrcnn_bbox , mrcnn_mask , rois , rpn_class , rpn_bbox , mrcnn_global_parsing_prob = self . keras_model . predict ( [ molded_images , molded_key1s , molded_key2s , molded_key3s , identity_ind , image_metas ] , verbose = 0 ) results = [ ] for i , image in enumerate ( images ) : final_rois , final_class_ids , final_scores , final_masks , final_globals = self . unmold_detections ( detections [ i ] , mrcnn_mask [ i ] , mrcnn_global_parsing_prob [ i ] , image . shape , windows [ i ] ) results . append ( { "rois" : final_rois , "class_ids" : final_class_ids , "scores" : final_scores , "masks" : final_masks , "global_parsing" : final_globals } ) return results
Runs the detection pipeline.
Runs the detection pipeline .
"""Runs the detection pipeline.

        images: List of images, potentially of different sizes.

        Returns a list of dicts, one dict per image. The dict contains:
        rois: [N, (y1, x1, y2, x2)] detection bounding boxes
        class_ids: [N] int class IDs
        scores: [N] float probability scores for the class IDs
        masks: [H, W, N] instance binary masks
        """ # Mold inputs to format expected by the neural network # Run object detection # Process detections
self
images
key1s
key2s
key3s
identity_ind