WICG/shape-detection-api

face detector fastMode as boolean may be too binary ?

jeromeetienne opened this issue · 2 comments

fastMode is a boolean which "Hint to the UA to try and prioritise speed over accuracy by e.g. operating on a reduced scale or looking for large features." - link

So it is a way for the user to express a preference about speed more than accuracy. I dont know if boolean isnt a bit binary. (pun on purpose :) )

One user may prefere speed over accuracy but just a bit, not all the way.

ps: It is just a thought about API flexibility. not that important

I would suggest a string enum over a boolean at least, that would at least put the property into discrete space. I don't think there is a need for this to be continuous.

I haven't dug into the docs specific to this attribute, but how exactly is an implementer expected to qualify fast versus slow, accuracy versus speed? What is that even expected to do? Not use the GPU? Use a different detection model? Use a different depth or distance from camera origin? Min/max bounds size?

If this is a question of speed vs thoroughness, it shouldn't be boolean so much as it should provide an SLA or a timeout basically that ensures you return the best result available within an allotted time. That would give the implementer an idea of what the expectation was when it goes through and selects the models and such to load when doing the detections. The implementer is likely to select the best benchmarked modeler given the hardware available anyway, so it seems like a weird argument to pass in as is. I get that it's intended to be async, but even async requests need to have expirations on them so you dont hang a request and never return.