Skip to main content

NetsPresso Python Package

Project description

NetsPresso Python Package




Use PyNetsPresso for a seamless model optimization process. PyNetsPresso resolves AI-related constraints in business use cases and enables cost-efficiency and enhanced performance by removing the requirement for high-spec servers and network connectivity and preventing high latency and personal data breaches.

The NetsPresso Python package is a python interface with the NetsPresso web application and REST API.

Easily compress various models with our resources. Please browse the Docs for details, and join our Discussion Forum for providing feedback or sharing your use cases.

To get started with the NetsPresso Python package, you will need to sign up either at NetsPresso or PyNetsPresso.

Installation

There are two ways you can install the NetsPresso Python Package: using pip or manually through our project GitHub repository.

To install this package, please use Python 3.8 or higher.

From PyPI (Recommended)

pip install netspresso

From Github

git clone https://github.com/Nota-NetsPresso/netspresso-python.git
pip install -e .

Quick Start

Login

To use the NetsPresso Python package, please enter the email and password registered in NetsPresso.

from netspresso.compressor import ModelCompressor

compressor = ModelCompressor(email="YOUR_EMAIL", password="YOUR_PASSWORD")

Upload Model

To upload your trained model, simply enter the required information.

When a model is successfully uploaded, a unique 'model.model_id' is generated to allow repeated use of the uploaded model.

from netspresso.compressor import Task, Framework

model = compressor.upload_model(
    model_name="YOUR_MODEL_NAME",
    task=Task.IMAGE_CLASSIFICATION,
    framework=Framework.TENSORFLOW_KERAS,
    file_path="YOUR_MODEL_PATH", # ex) ./model.h5
    input_shapes="YOUR_MODEL_INPUT_SHAPES",  # ex) [{"batch": 1, "channel": 3, "dimension": [32, 32]}]
)

Automatic Compression

Automatically compress the model by setting the compression ratio for the model.

Enter the ID of the uploaded model, the name and storage path of the compressed model, and the compression ratio.

compressed_model = compressor.automatic_compression(
    model_id=model.model_id,
    model_name="YOUR_COMPRESSED_MODEL_NAME",
    output_path="OUTPUT_PATH",  # ex) ./compressed_model.h5
    compression_ratio=0.5,
)

Contact

Join our Discussion Forum for providing feedback or sharing your use cases, and if you want to talk more with Nota, please contact us here.
Or you can also do it via email(contact@nota.ai) or phone(+82 2-555-8659)!

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netspresso-1.0.3.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

netspresso-1.0.3-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file netspresso-1.0.3.tar.gz.

File metadata

  • Download URL: netspresso-1.0.3.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for netspresso-1.0.3.tar.gz
Algorithm Hash digest
SHA256 faa8355ca04ba14d73cc6316396e24f614ddb6d251a369778d8357535a43a1be
MD5 cddaaf211e9ee5148bb4bd642eda8b93
BLAKE2b-256 8a59067f7c35e51fd7c532c2f1315a007a09ff5006e840183f650d9bade4346f

See more details on using hashes here.

File details

Details for the file netspresso-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: netspresso-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for netspresso-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d170e3491a431c9a77e4153e53ad0a3ce7ba54c7b66ccd5077e7e4f872317240
MD5 65a80826922a34f68f24bf81f47a6d50
BLAKE2b-256 cec4364b076d87624a8dfa57ddb53c1dfb296bf31bf79f8e7fd557437b881958

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page