-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[formrecognizer] Adding sync and async samples for ID documents #17186
[formrecognizer] Adding sync and async samples for ID documents #17186
Conversation
03c6eaa
to
0a6f354
Compare
0a6f354
to
6433a2e
Compare
path_to_sample_forms = os.path.abspath(os.path.join(os.path.abspath(__file__), | ||
"..", "./../sample_forms/id_documents/license.jpg")) | ||
|
||
# [START recognize_id_document] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to match the end clause
# [START recognize_id_document] | |
# [START recognize_id_documents] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd been going back and forth about having the s
at the end. Do you think I should rename the functions to have an s
at the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. I decided to add the s
to the function as well.
# FIXME: uncomment this | ||
# country = id_document.fields.get("Country") | ||
# if country: | ||
# print("Country: {} has confidence: {}".format(country.value, country.confidence)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it not finding "Country"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the last time I tried it :( Although it did work a couple of weeks ago, must be due to some changes on their end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I decided to leave it commented out for now, meanwhile they stabilize their endpoints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to comment it out? the code should still work if Country is not found and will automatically print when it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it's a little funky at the moment. It includes the confidence but not the country. So it actually does print out the line but says Country is None, but does include the confidence (I think it's just some regression they had for this endpoint since it was working before). The other reason I had it commented out was that in a previous iteration I could just do country.value to get the country name, but now I have to do country.value_data.text (although this is ALSO currently broken). So I commented it out because it seems this field is in flux. I dont have a problem uncommenting it though if you think it's better that way, I'll just add a note for myself to check it closer to release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay let's leave it commented out, I thought it wasn't finding the field at all
* [formrecognizer] Update generated code for preview.3 (#16833) * Adding generated code * update api-version dependent code * update test_receipt.py recordings * update generated code * update msrest dependency, add pages to custom form calls * skipping tests for undeployed endpoints * update pages doc comment * fix async operations and testcase handling * clean up response urls * adding content recordings * adding invoice test recordings * adding receipt recordings * update multiapi tests * update testcase and recordings * updating mgmt tests * update msrest requirement * update async client * [formrecognizer] Adding comment about image/bmp being accepted (#17130) * adding comment about image/bmp being accepted * add comments on async clients * update changelog * [formrecognizer] Add Identity Documents APIs (#17128) * Adding ID docs APIs and tests * comment test assertions, add recordings * pylint * fix type declaration * update changelog and descriptions * [formrecognizer] Adding sync and async samples for ID documents (#17186) * adding sync and async samples * rename sample function * get poller result instead of wait (#17299) * [formrecognizer] Add missing pages comments and tests (#17197) * add missing pages comments * update polling declaration in fr clients in custom forms * adding tests and recordings * updating changelog * remove extra pages tests in content tests * regenerate with latest preview 3 changes (#17400) * Adding more custom forms kwargs fixes (#17397) * pending id docs fixes (#17436) * [formrecognizer] rerecord tests for preview.3 (#17460) * enable business card and compose tests * enable training tests * rerecord training tests with correct multipage documents * rerecord copy tests with preview.3 * rerecord custom forms with preview.3 * rerecord invoices with preview.3 * rerecord receipts for preview.3 * rerecord mgmt tests for preview.3 Co-authored-by: Catalina Peralta <catalinaperaltah@hotmail.com> * add missing recording and unskip aad test * access correct env var for aad tests Co-authored-by: catalinaperalta <catalinaperaltah@hotmail.com>
[Hub Generated] Public private branch 'dev-digitaltwins-Microsoft.DigitalTwins-2021-06-30-preview-merge-with-main' (Azure#17186) * Adds base for updating Microsoft.DigitalTwins from version stable/2020-12-01 to version 2021-06-30-preview * Updates readme * Updates API version in new specs and examples * Add RM API Version Microsoft.DigitalTwins 2021-06-30-preview (#3404) * Add SDK Generation Options for new API Version (#3179) * Add SDK generation for 2021-06-30-preview * The following fixes were done: * Fixed schema location: preview instead of stable * Updated go SDK generation to point to preview namespace * Remove Ruby support * add SystemData and update instance and endpoints definitions * added systemdata to all examples * fix typo * fix prettier issues * added experimental operations fix * fixed some errors * addressed lint and model errors * fixed type issues with endpoints examples * Fixed autorest error * removed unnecessary _allOf_s * Add Time Series Database Connection Resource and CRUD API Endpoints (#3180) * Added basic time series integration resource CRUD and resource description * Add list call for TSDB integration resources * Modify naming for adx endpoint * Rename document names and paths from integration resources to time series database connections; also clean up descriptions, and make more specific to time series database connections (rather than general integrations) * Update operation names * Resolve review comments * Add examples for time series database connection CRUD * Add example for missing status code 200 to DELETE * Run prettier and fix formatting issues * Align tags, solve issue in Python SDK generation * Align python readme * Fix linter error * Fix linter error 2 * Fix linter error * Made privateEndpointConnections readonly, added additional documentation for keybased and entitybased authenticationType (#3358) * Address major lintdiff warnings * Fix more linter warnings * Address remaining lintdiff warnings and errors * Remove property flattening to avoid issues with polymorphism, edit suppression directives to point to new location * Address lintdiff error * Add systemData property to private endpoint connection resource * Address breaking change warnings * Fix inheritance * Update suppressions to point to new locations in document * Updated TSDB connection parameter set * Fix issue in property set * Revert readOnly=true from private endpoint connections property * Revert change to TopicEndpoint * Back to camelcase... * Revert change in old API version * Revert TopicEndpoint back to camelCase * Revert allOf addition * Change capitalization of TopicEndpoint back to original from previous version * Add approved suppression * Fix $.definitions path in suppression rules Co-authored-by: Nate Lehman <nalehman@microsoft.com> Co-authored-by: Nate Lehman <njlehman1@gmail.com> * Align with repo (#5658) Co-authored-by: Nate Lehman <nalehman@microsoft.com> Co-authored-by: Nate Lehman <njlehman1@gmail.com>
Addresses #16683