Last active
March 31, 2023 16:59
-
-
Save Riyasharma-in/0157b7ea19229c9b90119ec8d6977647 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
# re-order the bounding boxes by their position | |
for i in range(len(bboxes)-1): | |
for ind in range(len(df)-1): | |
if df.iloc[ind][4] > df.iloc[ind+1][0] and df.iloc[ind][1] > df.iloc[ind+1][1]: | |
#print(df.iloc[ind][4] , df.iloc[ind+1][0] , df.iloc[ind][1] , df.iloc[ind+1][1]) | |
df.iloc[ind], df.iloc[ind+1] = df.iloc[ind+1].copy(), df.iloc[ind].copy() | |
#print(df.iloc[ind], df.iloc[ind+1],'') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment