Skip to content

NanoNets/nanonets-python-client

Repository files navigation

nanonets

Welcome to the NanoNets API! You can use our API to build custom deep learning models for images.
We have language bindings in Shell, Ruby, Golang, Java, C# and Python! You can view code examples in the dark area to the right, and you can switch the programming language for the examples with the tabs in the top right.
In the documentation, you will find ready to fire code samples in these languages as well as detailed API specs for different endpoints.
# Model Object A model Object has 3 attributes
### model_id Definition: Unique Id for the model

### model_type Definition: Type of model. Possible values are:

classification Image classification model
localization Object detection model
multilabelclassification Multi label image classification model
ocr OCR model

### state Definition:Current state of model. Possible values are::
-1 Error in model training
0 Model created. No training data uploaded yet
1 Training data uploaded. Need to annotate data
2 Training data annotated. Need to start training
3 Model in training queue
4 Model currently training
5 Model hosted. Can be used for prediction

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 2.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen For more information, please visit https://nanonets.com

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import nanonets 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import nanonets

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import nanonets
from nanonets.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: ApiKey
configuration = nanonets.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = nanonets.ImagePredictApi(nanonets.ApiClient(configuration))
model_id = 'model_id_example' # str | 
file = 'file_example' # file | 

try:
    # Prediction for image File
    api_instance.image_categorization_label_file_post(model_id, file)
except ApiException as e:
    print("Exception when calling ImagePredictApi->image_categorization_label_file_post: %s\n" % e)
# Configure HTTP basic authorization: ApiKey
configuration = nanonets.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = nanonets.ImagePredictApi(nanonets.ApiClient(configuration))
model_id = 'model_id_example' # str | 
urls = 'urls_example' # str | 

try:
    # Prediction for image URLs
    api_instance.image_categorization_label_urls_post2(model_id, urls)
except ApiException as e:
    print("Exception when calling ImagePredictApi->image_categorization_label_urls_post2: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://app.nanonet.com/api/v2

Class Method HTTP request Description
ImagePredictApi image_categorization_label_file_post POST /ImageCategorization/LabelFile/ Prediction for image File
ImagePredictApi image_categorization_label_urls_post2 POST /ImageCategorization/LabelUrls/ Prediction for image URLs
ImageTrainApi image_categorization_train_post POST /ImageCategorization/Train/ Train Model
ImageUploadApi image_categorization_upload_file_post POST /ImageCategorization/UploadFile/ Upload training images by File
ImageUploadApi image_categorization_upload_urls_post POST /ImageCategorization/UploadUrls/ Upload training images by Url
ImageModelApi image_categorization_model_get GET /ImageCategorization/Model Get Model by Id
ImageModelApi image_categorization_model_post POST /ImageCategorization/Model/ Create New Model
ImageModelApi image_categorization_models_get GET /ImageCategorization/Models/ Get All Models
MultiLabelClassificationModelApi multi_label_classification_by_model_id_get GET /MultiLabelClassification/Model/{model_id} Get Model by Id
MultiLabelClassificationModelApi multi_label_image_classification_post POST /MultiLabelClassification/Model/ Create New Model
MultiLabelClassificationPredictApi multi_label_classification_label_files_post POST /MultiLabelClassification/Model/{model_id}/LabelFiles/ Prediction for image File
MultiLabelClassificationPredictApi multi_label_classification_post POST /MultiLabelClassification/Model/{model_id}/LabelUrls/ Prediction for image URLs
MultiLabelClassificationTrainApi multi_label_classification_model_train_by_model_id_post POST /MultiLabelClassification/Model/{model_id}/Train/ Train Model
MultiLabelClassificationUploadApi multi_label_classification_upload_files_post POST /MultiLabelClassification/Model/{model_id}/UploadFiles/ Upload training images by File
MultiLabelClassificationUploadApi multi_label_classification_upload_urls_post POST /MultiLabelClassification/Model/{model_id}/UploadUrls/ Upload training images by Urls
OCRModelApi o_cr_model_by_model_id_get GET /OCR/Model/{model_id} Get Model by Id
OCRModelApi o_cr_model_post POST /OCR/Model/ Create New Model
OCRPredictApi o_cr_model_label_file_by_model_id_post POST /OCR/Model/{model_id}/LabelFile/ Prediction for image file
OCRPredictApi o_cr_model_label_urls_by_model_id_post POST /OCR/Model/{model_id}/LabelUrls/ Prediction for image url
OCRTrainApi o_cr_model_train_by_model_id_post POST /OCR/Model/{model_id}/Train/ Train Model
OCRUploadApi o_cr_model_upload_file_by_model_id_post POST /OCR/Model/{model_id}/UploadFile/ Upload training images by File
OCRUploadApi o_cr_model_upload_urls_by_model_id_post POST /OCR/Model/{model_id}/UploadUrls/ Upload training images by Url
ObjectModelApi object_detection_model_by_model_id_get GET /ObjectDetection/Model/{model_id} Get Model by Id
ObjectModelApi object_detection_model_post POST /ObjectDetection/Model/ Create New Model
ObjectModelApi object_detection_models_get GET /OCR/Model/ Get All Models
ObjectModelApi object_detection_models_get_0 GET /ObjectDetection/Models/ Get All Models
ObjectPredictApi object_detection_model_label_file_by_model_id_post POST /ObjectDetection/Model/{model_id}/LabelFile/ Prediction for image file
ObjectPredictApi object_detection_model_label_urls_by_model_id_post POST /ObjectDetection/Model/{model_id}/LabelUrls/ Prediction for image url
ObjectTrainApi object_detection_model_train_by_model_id_post POST /ObjectDetection/Model/{model_id}/Train/ Train Model
ObjectUploadApi object_detection_model_upload_file_by_model_id_post POST /ObjectDetection/Model/{model_id}/UploadFile/ Upload training images by File
ObjectUploadApi object_detection_model_upload_urls_by_model_id_post POST /ObjectDetection/Model/{model_id}/UploadUrls/ Upload training images by Url

Documentation For Models

Documentation For Authorization

ApiKey

  • Type: HTTP basic authentication

Author

[email protected]

Releases

No releases published

Packages

No packages published