mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-17 00:25:23 +03:00
fix calculation
This commit is contained in:
parent
9a683bff93
commit
c52c984306
@ -198,10 +198,10 @@ class GenericONNXEmbedding:
|
|||||||
width, height = pil.size
|
width, height = pil.size
|
||||||
if width > 112 or height > 112:
|
if width > 112 or height > 112:
|
||||||
if width > height:
|
if width > height:
|
||||||
new_height = int(((width / height) * 112) // 4 * 4)
|
new_height = int(((height / width) * 112) // 4 * 4)
|
||||||
pil = pil.resize((112, new_height))
|
pil = pil.resize((112, new_height))
|
||||||
else:
|
else:
|
||||||
new_width = int(((height / width) * 112) // 4 * 4)
|
new_width = int(((width / height) * 112) // 4 * 4)
|
||||||
pil = pil.resize((new_width, 112))
|
pil = pil.resize((new_width, 112))
|
||||||
|
|
||||||
og = np.array(pil).astype(np.float32)
|
og = np.array(pil).astype(np.float32)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user