Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification on post processing #540

Open
lpkoh opened this issue Jul 16, 2022 · 0 comments
Open

Clarification on post processing #540

lpkoh opened this issue Jul 16, 2022 · 0 comments

Comments

@lpkoh
Copy link

lpkoh commented Jul 16, 2022

Hi, I am currently running demo.py with the aim of converting my own trained yolov4-csp model from darknet to pytorch. I wanted to clarify if the parameters for the post processing after detections were the same.

This is from darknet. It has three params, thresh, hier_thresh and nms.

def detect_image(network, class_names, image, thresh=.5, hier_thresh=.5, nms=.45):
    """
        Returns a list with highest confidence class and their bbox
    """
    pnum = pointer(c_int(0))
    predict_image(network, image)
    detections = get_network_boxes(network, image.w, image.h,
                                   thresh, hier_thresh, None, 0, pnum, 0)
    num = pnum[0]
    if nms:
        do_nms_sort(detections, num, len(class_names), nms)
    predictions = remove_negatives(detections, class_names, num)
    predictions = decode_detection(predictions)
    free_detections(detections, num)
    return sorted(predictions, key=lambda x: x[1])

For this repo, I see conf_thresh and nms_thresh as parameters.

def do_detect(model, img, conf_thresh, nms_thresh, use_cuda=1):
    model.eval()
    with torch.no_grad():
        t0 = time.time()

The provided values are 0.4 for conf_thresh and 0.6 for nms_thresh.

Can I clarify if conf_thresh corresponds to thresh, and nms_thresh corresponds to nms? Is there an equivalent for hier_thresh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant