Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Ultralytics Assistant 2024-09-26 00:41:38 +02:00 committed by GitHub
parent 4bcc80c646
commit 38e95f33a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 30 additions and 31 deletions

View file

@ -128,14 +128,13 @@ class ParkingPtsSelection:
rg_data = [] # regions data
for box in self.rg_data:
rs_box = [] # rescaled box list
for x, y in box:
rs_box.append(
(
int(x * self.imgw / self.canvas.winfo_width()), # width scaling
int(y * self.imgh / self.canvas.winfo_height()),
)
) # height scaling
rs_box = [
(
int(x * self.imgw / self.canvas.winfo_width()), # width scaling
int(y * self.imgh / self.canvas.winfo_height()), # height scaling
)
for x, y in box
]
rg_data.append({"points": rs_box})
with open("bounding_boxes.json", "w") as f:
json.dump(rg_data, f, indent=4)