Computer/ObjectDetection/TrafficLightDetection/TF_TrafficLightClassifier.py
def _getBoundingBoxCoordinates(self,box, height, width):
        """
        returns coordinates of bounding box in pixels
        :param box: 1 Tensor returned from tensorflow object detection prediction of 1 set of ymin, xmin, ymax, xmax
        :param height: height of image
        :param width: width of image
        :return: ymin, xmin, ymax, xmax coordinates in image of bounding box
        """
        # coordinates return the percent of height or width
        ymin, xmin, ymax, xmax = tuple(box.tolist())
        # convert to coordinate points
        ymin = int(ymin * height)
        ymax = int(ymax * height)
        xmin = int(xmin * width)
        xmax = int(xmax * width)
        return ymin, xmin, ymax, xmax

        returns coordinates of bounding box in pixels
        :param box: 1 Tensor returned from tensorflow object detection prediction of 1 set of ymin, xmin, ymax, xmax
        :param height: height of image
        :param width: width of image
        :return: ymin, xmin, ymax, xmax coordinates in image of bounding box
        
returns coordinates of bounding box in pixels
returns coordinates of bounding box in pixels
def _getBoundingBoxCoordinates(self,box, height, width):
        ymin, xmin, ymax, xmax = tuple(box.tolist())
        ymin = int(ymin * height)
        ymax = int(ymax * height)
        xmin = int(xmin * width)
        xmax = int(xmax * width)
        return ymin, xmin, ymax, xmax
def _getBoundingBoxCoordinates ( self , box , height , width ) : ymin , xmin , ymax , xmax = tuple ( box . tolist ( ) ) ymin = int ( ymin * height ) ymax = int ( ymax * height ) xmin = int ( xmin * width ) xmax = int ( xmax * width ) return ymin , xmin , ymax , xmax
returns coordinates of bounding box in pixels
returns coordinates of bounding box in pixels
"""
        returns coordinates of bounding box in pixels
        :param box: 1 Tensor returned from tensorflow object detection prediction of 1 set of ymin, xmin, ymax, xmax
        :param height: height of image
        :param width: width of image
        :return: ymin, xmin, ymax, xmax coordinates in image of bounding box
        """ # coordinates return the percent of height or width # convert to coordinate points
ymin, xmin, ymax, xmax coordinates in image of bounding box
ymin xmin ymax xmax coordinates in image of bounding box
self
box
1 Tensor returned from tensorflow object detection prediction of 1 set of ymin, xmin, ymax, xmax
1 Tensor returned from tensorflow object detection prediction of 1 set of ymin xmin ymax xmax
height
height of image
height of image
width
width of image
width of image