The Local
model definition enables you to import a model from your local machine.
#Feature
Currently, Instill Model supports importing models from
- ✅ A local
.zip
file
#Release Stage
Alpha
#Configuration
Field | Type | Note |
---|---|---|
content * | binary | a .zip file that contains all the model files |
#Getting Started
#Requirements
- A
.zip
file with all the model files
#Prepare a Local Model
The Local
model definition accepts a .zip
file that contains all files required for a model to be deployed.
Step 1: Download sample model In this case, we use the Object Detection model YOLOv7. Let's download and extract the contents of the sample model.
# Create a foldermkdir yolov7cd yolov7# Download sample modelcurl -o yolov7.zip https://artifacts.instill.tech/vdp/sample-models/yolov7.ziptar -xvf yolov7.ziprm yolov7.zip
The file structure in yolov7
should look like
.├── README.md├── model.onnx└── model.py
Step 2: Create a local model zip file
In /yolov7
directory
zip -r "yolov7.zip" . -x ".*"
🎉 The model is ready, just run the setup guide below, Instill Model wll import it accordingly.
Caveat
✅ Make sure that the compressed model files are in the root directory of the zip file.
zipinfo yolov7.zip# OutputArchive: yolov7.zipZip file size: 122612652 bytes, number of entries: 4-rw-r--r-- 3.0 unx 15857 tx defN 24-Apr-30 00:44 model.py-rw-r--r-- 3.0 unx 420 tx defN 24-Apr-30 00:44 README.md-rw-r--r-- 3.0 unx 147727196 bx defN 24-Apr-30 00:46 model.onnx4 files, 147743556 bytes uncompressed, 122612036 bytes compressed: 17.0%
❌ Do not compress the model files in another root directory
zipinfo yolov7.zip# OutputArchive: test.zipZip file size: 122612950 bytes, number of entries: 5drwxr-xr-x 3.0 unx 0 bx stor 24-Apr-30 00:53 yolov7/-rw-r--r-- 3.0 unx 15857 tx defN 24-Apr-30 00:44 yolov7/model.py-rw-r--r-- 3.0 unx 420 tx defN 24-Apr-30 00:44 yolov7/README.md-rw-r--r-- 3.0 unx 147727196 bx defN 24-Apr-30 00:46 yolov7/model.onnx5 files, 147743556 bytes uncompressed, 122612036 bytes compressed: 17.0%
#No-code Setup
To create a local model in the Console, do the following:
- Go to the Model page and click Add new model
- In the Set Up New Model page, fill an ID for your model, this will be the unique identifier of this model
- [Optional] Give a short description of your model in the Description field
- Click the Model source ▾ drop-down and choose Local
- Click Upload to upload the model
.zip
file and click Set up - Now go to the Model page, the corresponding model should be here. Note that it may take some time for the model to be deployed online.
#Low-code Setup
- Send a HTTP request to the Instill Model
model-backend
to import a local model.
- Deploy the imported model
yolov7
.
- Perform an inference to test the model