Faster R-CNN with Inception v2 for auto annotation (#541)
parent
418cdbe146
commit
cd5d43136d
@ -0,0 +1,6 @@
|
|||||||
|
# Faster R-CNN with Inception v2 (https://arxiv.org/pdf/1801.04381.pdf) pre-trained on the COCO dataset
|
||||||
|
|
||||||
|
### What is it?
|
||||||
|
* This application allows you automatically to annotate many various objects on images.
|
||||||
|
* It uses [Faster RCNN Inception Resnet v2 Atrous Coco Model](http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz) from [tensorflow detection model zoo](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md)
|
||||||
|
* It can work on CPU (with Tensorflow or OpenVINO) or GPU (with Tensorflow GPU).
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
threshold = .5
|
||||||
|
|
||||||
|
for detection in detections:
|
||||||
|
frame_number = detection['frame_id']
|
||||||
|
height = detection['frame_height']
|
||||||
|
width = detection['frame_width']
|
||||||
|
detection = detection['detections']
|
||||||
|
|
||||||
|
prediction = detection[0][0]
|
||||||
|
for obj in prediction:
|
||||||
|
obj_class = int(obj[1])
|
||||||
|
obj_value = obj[2]
|
||||||
|
if obj_value >= threshold:
|
||||||
|
x = obj[3] * width
|
||||||
|
y = obj[4] * height
|
||||||
|
right = obj[5] * width
|
||||||
|
bottom = obj[6] * height
|
||||||
|
|
||||||
|
results.add_box(x, y, right, bottom, obj_class, frame_number)
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
{
|
||||||
|
"label_map": {
|
||||||
|
"1": "person",
|
||||||
|
"2": "bicycle",
|
||||||
|
"3": "car",
|
||||||
|
"4": "motorcycle",
|
||||||
|
"5": "airplane",
|
||||||
|
"6": "bus",
|
||||||
|
"7": "train",
|
||||||
|
"8": "truck",
|
||||||
|
"9": "boat",
|
||||||
|
"10": "traffic_light",
|
||||||
|
"11": "fire_hydrant",
|
||||||
|
"13": "stop_sign",
|
||||||
|
"14": "parking_meter",
|
||||||
|
"15": "bench",
|
||||||
|
"16": "bird",
|
||||||
|
"17": "cat",
|
||||||
|
"18": "dog",
|
||||||
|
"19": "horse",
|
||||||
|
"20": "sheep",
|
||||||
|
"21": "cow",
|
||||||
|
"22": "elephant",
|
||||||
|
"23": "bear",
|
||||||
|
"24": "zebra",
|
||||||
|
"25": "giraffe",
|
||||||
|
"27": "backpack",
|
||||||
|
"28": "umbrella",
|
||||||
|
"31": "handbag",
|
||||||
|
"32": "tie",
|
||||||
|
"33": "suitcase",
|
||||||
|
"34": "frisbee",
|
||||||
|
"35": "skis",
|
||||||
|
"36": "snowboard",
|
||||||
|
"37": "sports_ball",
|
||||||
|
"38": "kite",
|
||||||
|
"39": "baseball_bat",
|
||||||
|
"40": "baseball_glove",
|
||||||
|
"41": "skateboard",
|
||||||
|
"42": "surfboard",
|
||||||
|
"43": "tennis_racket",
|
||||||
|
"44": "bottle",
|
||||||
|
"46": "wine_glass",
|
||||||
|
"47": "cup",
|
||||||
|
"48": "fork",
|
||||||
|
"49": "knife",
|
||||||
|
"50": "spoon",
|
||||||
|
"51": "bowl",
|
||||||
|
"52": "banana",
|
||||||
|
"53": "apple",
|
||||||
|
"54": "sandwich",
|
||||||
|
"55": "orange",
|
||||||
|
"56": "broccoli",
|
||||||
|
"57": "carrot",
|
||||||
|
"58": "hot_dog",
|
||||||
|
"59": "pizza",
|
||||||
|
"60": "donut",
|
||||||
|
"61": "cake",
|
||||||
|
"62": "chair",
|
||||||
|
"63": "couch",
|
||||||
|
"64": "potted_plant",
|
||||||
|
"65": "bed",
|
||||||
|
"67": "dining_table",
|
||||||
|
"70": "toilet",
|
||||||
|
"72": "tv",
|
||||||
|
"73": "laptop",
|
||||||
|
"74": "mouse",
|
||||||
|
"75": "remote",
|
||||||
|
"76": "keyboard",
|
||||||
|
"77": "cell_phone",
|
||||||
|
"78": "microwave",
|
||||||
|
"79": "oven",
|
||||||
|
"80": "toaster",
|
||||||
|
"81": "sink",
|
||||||
|
"83": "refrigerator",
|
||||||
|
"84": "book",
|
||||||
|
"85": "clock",
|
||||||
|
"86": "vase",
|
||||||
|
"87": "scissors",
|
||||||
|
"88": "teddy_bear",
|
||||||
|
"89": "hair_drier",
|
||||||
|
"90": "toothbrush"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue