diff options
| author | adamhrv <adam@ahprojects.com> | 2019-01-17 12:45:48 +0100 |
|---|---|---|
| committer | adamhrv <adam@ahprojects.com> | 2019-01-17 12:45:48 +0100 |
| commit | 03ad11fb2a3dcd425d50167b15d72d4e0ef536a2 (patch) | |
| tree | b443bc9a3c0986745164afffb5a9f59be8ed00d1 /megapixels/app/models/bbox.py | |
| parent | cb4d6d6f5be213edbc4f3b1e4452e5b7ce5e9378 (diff) | |
debugging face search demo
Diffstat (limited to 'megapixels/app/models/bbox.py')
| -rw-r--r-- | megapixels/app/models/bbox.py | 7 |
1 files changed, 7 insertions, 0 deletions
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 @@ -252,6 +252,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 :returns BBox |
