Step 4: Package model (beta)

Package the model so that it can be deployed directly to the device.

1. Go to Package page

Select New package at the drop-down menu that appears when you click Download button.

2. Package the model

Enter the package name and select a base model to package.

Please note that the package name will be the library name and the name cannot be changed after packaging.

You can include pre/post processing codes (.py) with the model for the package (optional).

Download the pre/post processing code example and modify for your use cases.

3. Download package file and run the package

Packaged file will be automatically downloaded.

To run the package, use the code written below. {package_name} must be changed to your package name.

from np_{package_name}.models.model import NPModel

NPModel.initialize(num_threads=1) # Initialize
npmodel = NPModel()
image_path = "./test.jpg" #Image path
print( # Inference
NPModel.finalize() # Memory management