Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This Gist repository contains code snippet related to Aspose.OMR Cloud SDK for Python
Aspose.OMR-Cloud-SDK-Python
# For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-python/
image_file_name = os.path.basename(template_image_path)
# upload template image
upload_file(storage_api, image_file_name, template_image_path)
# locate generated template file (.omr) and provide it's data as function parameter
template_data_path = os.path.join(template_data_dir, os.path.splitext(image_file_name)[0] + '.omr')
function_param = serialize_files([template_data_path])
call_params = OmrFunctionParam(function_param=function_param, additional_param='')
# call template correction
result = omr_api.post_run_omr_task(image_file_name, "CorrectTemplate", call_params)
return result
# For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-python/
template_file_name = os.path.basename(corrected_template_path)
# upload corrected template data on cloud
upload_file(storage_api, template_file_name, corrected_template_path)
# provide template id as function parameter
call_params = OmrFunctionParam(function_param=template_id, additional_param='')
# call template finalization
result = omr_api.post_run_omr_task(template_file_name, 'FinalizeTemplate', call_params)
return result
# For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-python/
image_file_name = os.path.basename(template_dst_name)
# upload image on cloud
upload_file(storage_api, image_file_name, template_dst_name)
# provide function parameters
omr_params = OmrFunctionParam(function_param=json.dumps(dict(ExtraStoragePath=logos_folder)), additional_param='')
return omr_api.post_run_omr_task(image_file_name, "GenerateTemplate", omr_params)
# For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-python/
image_file_name = os.path.basename(image_path)
# upload image on cloud
upload_file(storage_api, image_file_name, image_path)
# provide template id as function parameter
call_params = OmrFunctionParam(function_param=template_id, additional_param='')
# call image recognition
result = omr_api.post_run_omr_task(image_file_name, 'RecognizeImage', call_params)
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment