Open changhiskhan opened 2 years ago
@Renkai if you're looking for something to tackle, this is a good one
One alternative to adding an attribute is we could consider creating a RelativeGeometry mixin that has functionality to autoscale. Then we just create Relative*
subclasses of *
Geometry classes with the RelativeGeometry mixin added and (hopefully) nothing else.
Thoughts? @eddyxu ?
@changhiskhan Sounds interesting, but I have some questions.
Add a property in Image to retrieve the shape
?mixin
here? In Scala, I think it's trait
, but in Python, I'm not sure what is a proper way to implement mixin
.And can you address some links to the key classes or files on how we implement the box drawing mechanism in the current code base?
Key python file: https://github.com/eto-ai/rikai/blob/main/python/rikai/viz.py
Mixin: https://github.com/eto-ai/rikai/blob/main/python/rikai/mixin.py
Rikai Image depends on Mixins heavily.
Here is a related issue: https://github.com/eto-ai/rikai/issues/523
These DSL should be designed at the very beginning. And then we start to implement it.
I found that the box2d returned by AWS Rekognition (e.g. recognize celebrities) is relative box2d.
Currently if we have a relative Box, we need to manually rescale it by the image in order to draw it:
img | [box * (row.height, row.width) for box in row.annotations]
Instead we should consider: