worldcoin / open-iris

Open Iris Recognition Inference System (IRIS)
MIT License
242 stars 49 forks source link

How get only pupil or iris size box ? #41

Open DimIsaev opened 4 months ago

DimIsaev commented 4 months ago

how to call one of the API methods to get pupil or iris sizes

thanks

DimIsaev commented 4 months ago

Is there a chance that someone will answer?

EliteWeapon commented 3 months ago

how to call one of the API methods to get pupil or iris sizes

thanks

You can make your own 'pipeline_output_builder' in the environment when building pipeline and extract the size of pupil or iris from 'call_trace["geometry_estimation"]'. Please refer to the implementations in file 'src/iris/orchestration/output_builders.py'.

DimIsaev commented 3 months ago

You can make your own 'pipeline_output_builder' in the environment when building pipeline and extract the size of pupil or iris from 'call_trace["geometry_estimation"]'. Please refer to the implementations in file 'src/iris/orchestration/output_builders.py'.

thanks for the answer but how this builder is formed is not very clear from the file

wiktorlazarski commented 3 months ago

Hey @DimIsaev,

thank you for raising the issue. @EliteWeapon is right. You can extract that information from metadata returned from pipeline_output_builder. If for some reason you only want to the pipeline to return only iris and pupil bounding box sizes, you have to implement your own pipeline builder.

How to do it? Please, first have a look at our Getting started tutorial. After studying the second section of this tutorial 2. Configuring IRISPipeline environment you should understand how IRISPipeline's Environment is configure - then you will know how to swap pipeline_output_builder.

How to implement your own pipeline_output_builder? Please refer to already cited by @EliteWeapon file in our repo src/iris/orchestration/output_builders.py. There you will find examples of several such builder functions:

Please let me know if that helps.

@EliteWeapon Thank you also for answering.

Best regards, Wiktor

TanguyJeanneau commented 3 months ago

Hi @DimIsaev,

Alternatively you can use the bounding box information already present in the default metadata. The width or height of the bounding box will give you the iris / pupil diameter.

Please let us know if that answers your question !

Tanguy

DimIsaev commented 3 months ago

Hi @DimIsaev,

Alternatively you can use the bounding box information already present in the default metadata. The width or height of the bounding box will give you the iris / pupil diameter.

Please let us know if that answers your question !

@TanguyJeanneau

great answer, to some other question

I need to separately obtain only these parameters without additional calculations since you need to determine these parameters in real time which does not allow the inference speed to be around 500ms even on a GPU

DimIsaev commented 3 months ago

Can I hope for an answer?

Maybe we should close the Issues section?

wiktorlazarski commented 3 months ago

@DimIsaev

Sorry for the late answer but we were swamped with other priorities. Regarding the issue, I think you should study tutorials we provided again. You will learn from them:

A small comment, I'm still not sure if you manage to configure pipeline such that it will run with the time performance you expect but it's something you should for sure check out and try it yourself. Main time complexity comes from semantic segmentation model. We never considered making this one run in real time so feel free to check out other algorithms that does that and maybe you will get some time performance improvement. We also encourage you to contribute any improvements you may find relevant and help open-iris package grow.

Best regards, Wiktor

wiktorlazarski commented 1 week ago

Hey @DimIsaev,

Please, let me know if you manage to solve your problem, so we can close this issue, or you still would like some support from our side?

Best regards, Wiktor