Ultralytics Code Refactor https://ultralytics.com/actions (#16493)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
4bcc80c646
commit
38e95f33a5
6 changed files with 30 additions and 31 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue