Created
March 19, 2018 13:31
-
-
Save sjain07/645bd82bd274c359a35a4e825f73a1c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, os, sys | |
model_id = os.environ.get('NANONETS_MODEL_ID') | |
api_key = os.environ.get('NANONETS_API_KEY') | |
image_path = sys.argv[1] | |
url = 'https://app.nanonets.com/api/v2/ObjectDetection/Model/' + model_id + '/LabelFile/' | |
data = {'file': open(image_path, 'rb'), 'modelId': ('', model_id)} | |
response = requests.post(url, auth=requests.auth.HTTPBasicAuth(api_key, ''), files=data) | |
print(response.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment