def detect(net, meta, im, thresh=0.2, hier_thresh=0, nms=0.4):
    '\n    Detect the objects in the given image. free_image function is called inside this function.\n    Therefore the input darkent image is not usable after calling this function.\n    :param net:\n    :param meta:\n    :param im:\n    :param thresh:\n    :param hier_thresh:\n    :param nms:\n    :return:\n    '
    num = c_int(0)
    pnum = pointer(num)
    predict_image(net, im)
    dets = get_network_boxes(net, im.w, im.h, thresh, hier_thresh, None, 0, pnum)
    num = pnum[0]
    if nms:
        do_nms_sort(dets, num, meta.classes, nms)
    res = []
    for j in range(num):
        for i in range(meta.classes):
            if (dets[j].prob[i] > 0):
                b = dets[j].bbox
                res.append(YoloData(id=i, name=meta.names[i], bbox=BBox((b.x - (b.w / 2.0)), (b.y - (b.h / 2.0)), b.w, b.h, dets[j].prob[i])))
    res = sorted(res, key=(lambda x: (- x.bbox.c)))
    free_image(im)
    free_detections(dets, num)
    return res
Detect the objects in the given image. free_image function is called inside this function.
Therefore the input darkent image is not usable after calling this function.
:param net:
:param meta:
:param im:
:param thresh:
:param hier_thresh:
:param nms:
:return:
def detect(net, meta, im, thresh=0.2, hier_thresh=0, nms=0.4):
    '\n    Detect the objects in the given image. free_image function is called inside this function.\n    Therefore the input darkent image is not usable after calling this function.\n    :param net:\n    :param meta:\n    :param im:\n    :param thresh:\n    :param hier_thresh:\n    :param nms:\n    :return:\n    '
    num = c_int(0)
    pnum = pointer(num)
    predict_image(net, im)
    dets = get_network_boxes(net, im.w, im.h, thresh, hier_thresh, None, 0, pnum)
    num = pnum[0]
    if nms:
        do_nms_sort(dets, num, meta.classes, nms)
    res = []
    for j in range(num):
        for i in range(meta.classes):
            if (dets[j].prob[i] > 0):
                b = dets[j].bbox
                res.append(YoloData(id=i, name=meta.names[i], bbox=BBox((b.x - (b.w / 2.0)), (b.y - (b.h / 2.0)), b.w, b.h, dets[j].prob[i])))
    res = sorted(res, key=(lambda x: (- x.bbox.c)))
    free_image(im)
    free_detections(dets, num)
    return res