summaryrefslogtreecommitdiff
path: root/megapixels/app/models
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-12-15 16:41:07 +0100
committerJules Laplace <julescarbon@gmail.com>2018-12-15 16:41:07 +0100
commitc5b02ffab8d388e8a2925e51736b902a48a95e71 (patch)
tree694ede9e97c667ca4fdda8ccccad3676bccd3479 /megapixels/app/models
parent485cf0e4665c660d4e5e1fba00a95bc8036809c6 (diff)
parent1690cfb4cc7b7277afca4016c295927cc4f7fafb (diff)
Merge branch 'master' of github.com:adamhrv/megapixels_dev
Diffstat (limited to 'megapixels/app/models')
-rw-r--r--megapixels/app/models/bbox.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/megapixels/app/models/bbox.py b/megapixels/app/models/bbox.py
index e6da960e..55a92512 100644
--- a/megapixels/app/models/bbox.py
+++ b/megapixels/app/models/bbox.py
@@ -262,6 +262,12 @@ class BBox:
rect = cls.normalize(cls, rect, dim)
return cls(*rect)
+ def __str__(self):
+ return f'BBox: ({self._x1},{self._y1}), ({self._x2}, {self._y2}), width:{self._width}, height:{self._height}'
+
+ def __repr__(self):
+ return f'BBox: ({self._x1},{self._y1}), ({self._x2}, {self._y2}), width:{self._width}, height:{self._height}'
+
def str(self):
"""Return BBox as a string "x1, y1, x2, y2" """
return self.as_box()