Dev diana
Created by: dianamariand92
Description
Integrate execution support from the command line for DEEPaaS, through the deepaas-execute command.
Type of change
-
New feature (non-breaking change which adds functionality)
How Has This Been Tested?
The command has been tested with several of the examples found in the DEEP OPEN CATALOG. The models were tested with the DEEPaaS API V2 and is not compatible with the V1.
$ deepaas-execute -h usage: deepaas-execute [-h] [-ct CONTENT_TYPE] -o OUTPUT [--url URL] input_file
######Option to obtain the prediction of the model through the command line.#####
positional arguments: input_file Set input file to predict
optional arguments: -h, --help show this help message and exit -ct CONTENT_TYPE, --content_type CONTENT_TYPE Especify the content type of the output file ('image/png', 'application/json', 'application/zip (by default application/json)') -o OUTPUT, --output OUTPUT Save the result to a local file. --url URL Activate url as input file type.
Example with a file: $ deepaas-execute frisbee.jpg -o output/
Example with an url: $ deepaas-execute https://storage.googleapis.com/tfjs-models/assets/posenet/frisbee.jpg --url TRUE -o output/
In the previous examples, the content-type of the output is a .json file (by default) with the prediction result. It is possible to specify other content-type with the option -ct or --content_type like image/png, if the model allows obtaining an output image in the prediction as is the case of pose estimation and it is also possible to specify application/zip to obtain a .zip at the output with the image and a .json file with the prediction.
Checklist:
-
My code follows the style guidelines of this project -
I have performed a self-review of my own code -
I have commented my code, particularly in hard-to-understand areas -
I have made corresponding changes to the documentation -
My changes generate no new warnings -
I have added tests that prove my fix is effective or that my feature works -
New and existing unit tests pass locally with my changes