From 03ad11fb2a3dcd425d50167b15d72d4e0ef536a2 Mon Sep 17 00:00:00 2001 From: adamhrv Date: Thu, 17 Jan 2019 12:45:48 +0100 Subject: debugging face search demo --- megapixels/app/models/bbox.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'megapixels/app/models/bbox.py') diff --git a/megapixels/app/models/bbox.py b/megapixels/app/models/bbox.py index f65f7373..608aaaf8 100644 --- a/megapixels/app/models/bbox.py +++ b/megapixels/app/models/bbox.py @@ -251,6 +251,13 @@ class BBox: # ----------------------------------------------------------------- # Create from + @classmethod + def from_xywh_norm(cls, x, y, w, h): + """Converts w, y, w, h to normalized BBox + :returns BBox + """ + return cls(x, y, x + w, y + h) + @classmethod def from_xyxy_dim(cls, x1, y1, x2, y2, dim): """Converts x1, y1, w, h to BBox and normalizes -- cgit v1.2.3-70-g09d2