Created
September 11, 2020 04:16
-
-
Save pranjalAI/174fa9db0e65caf87b35be5b7d7bb57b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Importing Libraries | |
import os | |
import numpy as np | |
import cv2 | |
import argparse | |
import time | |
from tqdm import tqdm | |
#convert from Yolo_mark to opencv format | |
def yoloFormattocv(x1, y1, x2, y2, H, W): | |
bbox_width = x2 * W | |
bbox_height = y2 * H | |
center_x = x1 * W | |
center_y = y1 * H | |
voc = [] | |
voc.append(center_x - (bbox_width / 2)) | |
voc.append(center_y - (bbox_height / 2)) | |
voc.append(center_x + (bbox_width / 2)) | |
voc.append(center_y + (bbox_height / 2)) | |
return [int(v) for v in voc] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment