Created
March 31, 2023 16:36
-
-
Save Riyasharma-in/41b08715142c5010255058392c89e8fa to your computer and use it in GitHub Desktop.
Sorting and Automate Adjustment
This file contains 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
# convert bounding boxes to [x, y, w, h] format | |
bboxes = [[box[0], box[1], box[2]-box[0], box[3]-box[1]] for box in bboxes] | |
# create a pandas dataframe from the bounding boxes | |
df = pd.DataFrame(bboxes, columns=['x','y','w', 'h'], dtype=int) | |
# add a column for the x-coordinate on the right side of the bounding box | |
df["x2"] = df["x"]+df["w"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment