Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rs/docs update #1008

Open
wants to merge 155 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
7cd8dbf
added user guide
robertgshaw2-neuralmagic Mar 16, 2023
a818bce
Delete qa_server_config.yaml
robertgshaw2-neuralmagic Mar 16, 2023
0dfb6e1
removed gatsby headers
robertgshaw2-neuralmagic Mar 16, 2023
b0d3454
update benchmarking
robertgshaw2-neuralmagic Mar 16, 2023
6124994
Update benchmarking.md
robertgshaw2-neuralmagic Mar 16, 2023
a18a79b
Update and rename benchmarking.md to deepsparse-benchmarking.md
robertgshaw2-neuralmagic Mar 16, 2023
639b8c1
Update deepsparse-pipelines.md
robertgshaw2-neuralmagic Mar 16, 2023
5b5c23a
Update deepsparse-server.md
robertgshaw2-neuralmagic Mar 16, 2023
15624f6
Update scheduler.md
robertgshaw2-neuralmagic Mar 16, 2023
17a2e68
Update user-guide/scheduler.md
robertgshaw2-neuralmagic Mar 16, 2023
8053834
Update user-guide/scheduler.md
robertgshaw2-neuralmagic Mar 16, 2023
eb57109
Update user-guide/scheduler.md
robertgshaw2-neuralmagic Mar 16, 2023
3946aca
Update user-guide/deepsparse-pipelines.md
robertgshaw2-neuralmagic Mar 16, 2023
d9803bb
Update user-guide/deepsparse-pipelines.md
robertgshaw2-neuralmagic Mar 16, 2023
7e0a97b
Update user-guide/deepsparse-pipelines.md
robertgshaw2-neuralmagic Mar 16, 2023
ca0f27d
added README
robertgshaw2-neuralmagic Mar 16, 2023
61d1126
Merge branch 'rs/docs-update-user-guide' of github.com:neuralmagic/de…
robertgshaw2-neuralmagic Mar 16, 2023
7a55eec
Update README.md
robertgshaw2-neuralmagic Mar 16, 2023
f18acb3
Update README.md
robertgshaw2-neuralmagic Mar 16, 2023
9e5f05f
Update README.md
robertgshaw2-neuralmagic Mar 16, 2023
8a2c666
Update README.md
robertgshaw2-neuralmagic Mar 16, 2023
8ff12f5
Update README.md
robertgshaw2-neuralmagic Mar 16, 2023
19804f2
Update README.md
robertgshaw2-neuralmagic Mar 16, 2023
53e9a93
Update README.md
robertgshaw2-neuralmagic Mar 16, 2023
d8972f2
added sentiment-analysis
robertgshaw2-neuralmagic Mar 16, 2023
e9e2685
Update sentiment-analysis.md
robertgshaw2-neuralmagic Mar 16, 2023
dd5bdfd
added installation
robertgshaw2-neuralmagic Mar 16, 2023
b84e01e
Update installation.md
robertgshaw2-neuralmagic Mar 16, 2023
c145ac4
Update installation.md
robertgshaw2-neuralmagic Mar 16, 2023
f978ba4
Update README.md
robertgshaw2-neuralmagic Mar 16, 2023
380cf6e
Update deepsparse-pipelines.md
robertgshaw2-neuralmagic Mar 16, 2023
643af49
Update deepsparse-pipelines.md
robertgshaw2-neuralmagic Mar 16, 2023
12092ee
add text classification doc
mwitiderrick Mar 20, 2023
13ac283
add text classification doc
mwitiderrick Mar 21, 2023
3c256d2
add text classification doc
mwitiderrick Mar 21, 2023
eaaca7a
Use Engine
mwitiderrick Mar 21, 2023
1b5cf02
add question answering document
mwitiderrick Mar 21, 2023
dd2bed8
add token classification document
mwitiderrick Mar 22, 2023
2108ed6
update benchmarks
mwitiderrick Mar 22, 2023
d057130
add transformers extraction embedding doc
mwitiderrick Mar 22, 2023
ddb3091
add general embedding doc
mwitiderrick Mar 22, 2023
e99a196
add image classification doc
mwitiderrick Mar 23, 2023
a7acf3c
add image classification doc
mwitiderrick Mar 23, 2023
2b74cf1
add yolo document
mwitiderrick Mar 23, 2023
9fed9c8
add YOLACT doc
mwitiderrick Mar 24, 2023
bd227f0
update yolov5 doc
mwitiderrick Mar 24, 2023
1a7334d
update yolov5 doc
mwitiderrick Mar 24, 2023
46e78c2
Update yolov5-object-detection.md
mwitiderrick Apr 3, 2023
92e4dc8
Update image-classification.md
mwitiderrick Apr 3, 2023
d259fbc
Update image-segmentation-yolact.md
mwitiderrick Apr 3, 2023
59c3efe
Apply suggestions from code review
mgoin Apr 12, 2023
0412a98
Merge branch 'main' into rs/docs-update-user-guide
mgoin Apr 12, 2023
5f77059
Merge branch 'main' into rs/docs-update-use-cases
mgoin Apr 13, 2023
6a1a7d9
RS Edits to CV
robertgshaw2-neuralmagic Apr 17, 2023
ae25136
updated embedding extraction example
robertgshaw2-neuralmagic Apr 17, 2023
94b2f04
updated sentiment analysis and text classification examples
robertgshaw2-neuralmagic Apr 17, 2023
4ebdc59
added zero shot text classification
robertgshaw2-neuralmagic Apr 17, 2023
0a56876
RS edited token classification
robertgshaw2-neuralmagic Apr 18, 2023
e31c22e
updated question answering example
robertgshaw2-neuralmagic Apr 18, 2023
f260be7
updated embedding extraction case
robertgshaw2-neuralmagic Apr 18, 2023
558773c
Merge pull request #1003 from neuralmagic/rs/docs-update-user-guide
robertgshaw2-neuralmagic Apr 18, 2023
05a7f07
updated directory structure
robertgshaw2-neuralmagic Apr 18, 2023
588b658
updated dir structure
robertgshaw2-neuralmagic Apr 18, 2023
7cb5671
updated dir structure
robertgshaw2-neuralmagic Apr 18, 2023
b483960
Update image-classification.md
robertgshaw2-neuralmagic Apr 18, 2023
0fd2eb1
Update image-classification.md
robertgshaw2-neuralmagic Apr 18, 2023
d89739b
Update image-classification.md
robertgshaw2-neuralmagic Apr 18, 2023
6942c5c
Update object-detection-yolov5.md
robertgshaw2-neuralmagic Apr 18, 2023
bc28cf1
Update object-detection-yolov5.md
robertgshaw2-neuralmagic Apr 18, 2023
2297bec
Update object-detection-yolov5.md
robertgshaw2-neuralmagic Apr 18, 2023
ef32b3a
Update image-segmentation-yolact.md
robertgshaw2-neuralmagic Apr 18, 2023
5390079
Update image-segmentation-yolact.md
robertgshaw2-neuralmagic Apr 18, 2023
0755b3a
Update embedding-extraction.md
robertgshaw2-neuralmagic Apr 18, 2023
739ba15
Update sentiment-analysis.md
mwitiderrick Apr 19, 2023
dc724e1
Update question-answering.md
mwitiderrick Apr 19, 2023
59790f9
Update text-classification.md
mwitiderrick Apr 19, 2023
8fbee7a
Update embedding-extraction.md
robertgshaw2-neuralmagic Apr 19, 2023
c7287c5
Create README.md
robertgshaw2-neuralmagic Apr 19, 2023
b00ea3c
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
cab0f2c
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
c02a9a4
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
4e9a61c
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
e0b3fc6
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
ea2915c
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
f05ba01
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
847621b
Update deepsparse-pipelines.md
robertgshaw2-neuralmagic Apr 19, 2023
1b672c9
Update deepsparse-pipelines.md
robertgshaw2-neuralmagic Apr 19, 2023
0482754
Update deepsparse-pipelines.md
robertgshaw2-neuralmagic Apr 19, 2023
a78f494
Update deepsparse-server.md
robertgshaw2-neuralmagic Apr 19, 2023
f9914bb
Update deepsparse-pipelines.md
robertgshaw2-neuralmagic Apr 19, 2023
e6420d3
Update deepsparse-server.md
robertgshaw2-neuralmagic Apr 19, 2023
66e264b
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
3633383
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
981774a
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
a2ecfa7
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
b8af6ba
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
0e123ef
Update image-segmentation-yolact.md
robertgshaw2-neuralmagic Apr 19, 2023
c2aa202
Update image-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
2e267cd
Update object-detection-yolov5.md
robertgshaw2-neuralmagic Apr 19, 2023
bc12263
Update question-answering.md
robertgshaw2-neuralmagic Apr 19, 2023
d18f1eb
Update sentiment-analysis.md
robertgshaw2-neuralmagic Apr 19, 2023
c55572c
Update text-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
a444ee3
Update token-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
94f2644
Update transformers-embedding-extraction.md
robertgshaw2-neuralmagic Apr 19, 2023
cb8b5dd
Update zero-shot-text-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
8bca17d
Update question-answering.md
robertgshaw2-neuralmagic Apr 19, 2023
248ea13
Update question-answering.md
robertgshaw2-neuralmagic Apr 19, 2023
c6dda09
Update question-answering.md
robertgshaw2-neuralmagic Apr 19, 2023
3f1a30d
Update sentiment-analysis.md
robertgshaw2-neuralmagic Apr 19, 2023
2d3a89e
Update sentiment-analysis.md
robertgshaw2-neuralmagic Apr 19, 2023
c90cb3e
Update sentiment-analysis.md
robertgshaw2-neuralmagic Apr 19, 2023
a519ba0
Update text-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
417cf3a
Update text-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
b13e28e
Update text-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
f5a535c
Update text-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
bae0836
Update token-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
98ec61e
Update token-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
8d1c257
Update zero-shot-text-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
c3403d5
Update zero-shot-text-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
f86a976
Update zero-shot-text-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
ffc4911
Update transformers-embedding-extraction.md
robertgshaw2-neuralmagic Apr 19, 2023
645fd24
Update embedding-extraction.md
robertgshaw2-neuralmagic Apr 19, 2023
f48b58d
Update image-classification.md
robertgshaw2-neuralmagic Apr 19, 2023
aa59bc6
Update image-segmentation-yolact.md
robertgshaw2-neuralmagic Apr 19, 2023
a62be31
Update object-detection-yolov5.md
robertgshaw2-neuralmagic Apr 19, 2023
cb7d614
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
352f7e3
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
d215b47
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
f365fba
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
73ec549
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
08b5c69
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
4581506
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
3e73375
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
c560c09
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
2435705
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
8675523
Add files via upload
robertgshaw2-neuralmagic Apr 19, 2023
eef8116
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
0bc84a8
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
a31969a
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
d1fa169
added copyrights
robertgshaw2-neuralmagic Apr 19, 2023
b99fd9f
Merge branch 'main' into rs/docs-update-use-cases
robertgshaw2-neuralmagic Apr 19, 2023
593e130
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
60b8dbd
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
9be3f50
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
7ec9e9e
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
6be665e
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
1e85839
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
517d5d8
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
a84edb0
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
89714eb
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
bc4590b
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
f8893ed
Update README.md
robertgshaw2-neuralmagic Apr 19, 2023
0d799b7
reset to qaed state
robertgshaw2-neuralmagic Apr 24, 2023
3b800a8
Merge branch 'main' into rs/docs-update
robertgshaw2-neuralmagic Apr 24, 2023
4a15621
restored src/*
robertgshaw2-neuralmagic Apr 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 103 additions & 112 deletions README.md

Large diffs are not rendered by default.

Binary file added docs/neural-magic-workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
90 changes: 90 additions & 0 deletions docs/use-cases/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!--
Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Use Cases

There are three interfaces for interacting with DeepSparse:

- **Engine** is the lowest-level API that enables you to compile a model and run inference on raw input tensors.

- **Pipeline** is the default DeepSparse API. Similar to Hugging Face Pipelines, it wraps Engine with task-specific pre-processing and post-processing steps, allowing you to make requests on raw data and receive post-processed predictions.

- **Server** is a REST API wrapper around Pipelines built on FastAPI and Uvicorn. It enables you to start a model serving endpoint running DeepSparse with a single CLI.

This directory offers examples using each API in various supported tasks.

### Supported Tasks

DeepSparse supports the following tasks out of the box:

| NLP | CV |
|-----------------------|---------------------------|
| [Text Classification `"text-classification"`](nlp/text-classification.md) | [Image Classification `"image_classification"`](cv/image-classification.md) |
| [Token Classification `"token-classification"`](nlp/token-classification.md) | [Object Detection `"yolo"`](cv/object-detection-yolov5.md) |
| [Sentiment Analysis `"sentiment-analysis"`](nlp/sentiment-analysis.md) | [Instance Segmentation `"yolact"`](cv/image-segmentation-yolact.md) |
| [Question Answering `"question-answering"`](nlp/question-answering.md) | |
| [Zero-Shot Text Classification `"zero-shot-text-classification"`](nlp/zero-shot-text-classification.md) | |
| [Embedding Extraction `"transformers_embedding_extraction"`](nlp/transformers-embedding-extraction.md) | |

### Examples

**Pipeline Example** | Sentiment Analysis

Here's an example of how a task is used to create a Pipeline:

```python
from deepsparse import Pipeline

pipeline = Pipeline.create(
task="sentiment_analysis",
model_path="zoo:nlp/sentiment_analysis/obert-base/pytorch/huggingface/sst2/pruned90_quant-none")

print(pipeline("I love DeepSparse Pipelines!"))
# labels=['positive'] scores=[0.998009443283081]
```

**Server Example** | Sentiment Analysis

Here's an example of how a task is used to create a Server:

```bash
deepsparse.server \
--task sentiment_analysis \
--model_path zoo:nlp/sentiment_analysis/obert-base/pytorch/huggingface/sst2/pruned90_quant-none
```

Making a request:

```python
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'

# send the data
obj = {"sequences": "Sending requests to DeepSparse Server is fast and easy!"}
resp = requests.post(url=url, json=obj)

# recieve the post-processed output
print(resp.text)
# >> {"labels":["positive"],"scores":[0.9330279231071472]}
```

### Additional Resources

- [Custom Tasks](../user-guide/deepsparse-pipelines.md#custom-use-case)
- [Pipeline User Guide](../user-guide/deepsparse-pipelines.md)
- [Server User Guide](../user-guide/deepsparse-server.md)
130 changes: 130 additions & 0 deletions docs/use-cases/cv/embedding-extraction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<!--
Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Deploying Embedding Extraction Models With DeepSparse
This page explains how to deploy an Embedding Extraction Pipeline with DeepSparse.

## Installation Requirements
This use case requires the installation of [DeepSparse Server](../../user-guide/installation.md).

Confirm your machine is compatible with our [hardware requirements](../../user-guide/hardware-support.md).

## Model Format
The Embedding Extraction Pipeline enables you to generate embeddings in any domain, meaning you can use it with any ONNX model. It (optionally) removes the projection head from the model, such that you can re-use SparseZoo models and custom models you have trained in the embedding extraction scenario.

There are two options for passing a model to the Embedding Extraction Pipeline:

- Pass a Local ONNX File
- Pass a SparseZoo Stub (which identifies an ONNX model in the SparseZoo)

## DeepSparse Pipelines
Pipeline is the default interface for interacting with DeepSparse.

Like Hugging Face Pipelines, DeepSparse Pipelines wrap pre- and post-processing around the inference performed by the Engine. This creates a clean API that allows you to pass raw text and images to DeepSparse and receive the post-processed predictions, making it easy to add DeepSparse to your application.

We will use the `Pipeline.create()` constructor to create an instance of an embedding extraction Pipeline with a 95% pruned-quantized version of ResNet-50 trained on `imagenet`. We can then pass images the `Pipeline` and receive the embeddings. All of the pre-processing is handled by the `Pipeline`.

The Embedding Extraction Pipeline handles some useful actions around inference:

- First, on initialization, the Pipeline (optionally) removes a projection head from a model. You can use the `emb_extraction_layer` argument to specify which layer to return. If your ONNX model has no projection head, you can set `emb_extraction_layer=None` (the default) to skip this step.

- Second, as with all DeepSparse Pipelines, it handles pre-processing such that you can pass raw input. You will notice that in addition to the typical task argument used in `Pipeline.create()`, the Embedding Extraction Pipeline includes a `base_task` argument. This argument tells the Pipeline the domain of the model, such that the Pipeline can figure out what pre-processing to do.

Download an image to use with the Pipeline.
```bash
wget https://huggingface.co/spaces/neuralmagic/image-classification/resolve/main/lion.jpeg
```

This is an example of extracting the last layer from ResNet-50:

```python
from deepsparse import Pipeline

# this step removes the projection head before compiling the model
rn50_embedding_pipeline = Pipeline.create(
task="embedding-extraction",
base_task="image-classification", # tells the pipeline to expect images and normalize input with ImageNet means/stds
model_path="zoo:cv/classification/resnet_v1-50/pytorch/sparseml/imagenet/pruned95_quant-none",
emb_extraction_layer=-3, # extracts last layer before projection head and softmax
)

# this step runs pre-processing, inference and returns an embedding
embedding = rn50_embedding_pipeline(images="lion.jpeg")
print(len(embedding.embeddings[0][0]))
# 2048 << size of final layer>>
```

### Cross Use Case Functionality
Check out the [Pipeline User Guide](../../user-guide/deepsparse-pipelines.md) for more details on configuring the Pipeline.

## DeepSparse Server
As an alternative to the Python API, DeepSparse Server allows you to serve an Embedding Extraction Pipeline over HTTP. Configuring the server uses the same parameters and schemas as the Pipelines.

Once launched, a `/docs` endpoint is created with full endpoint descriptions and support for making sample requests.

This configuration file sets `emb_extraction_layer` to -3:
```yaml
# config.yaml
endpoints:
- task: embedding_extraction
model: zoo:cv/classification/resnet_v1-50/pytorch/sparseml/imagenet/pruned95_quant-none
kwargs:
base_task: image_classification
emb_extraction_layer: -3
```
Spin up the server:
```bash
deepsparse.server --config_file config.yaml
```

Make requests to the server:
```python
import requests, json
url = "http://0.0.0.0:5543/predict/from_files"
paths = ["lion.jpeg"]
files = [("request", open(img, 'rb')) for img in paths]
resp = requests.post(url=url, files=files)
result = json.loads(resp.text)

print(len(result["embeddings"][0][0]))

# 2048 << size of final layer>>
```
## Using a Custom ONNX File
Apart from using models from the SparseZoo, DeepSparse allows you to define custom ONNX files for embedding extraction.

The first step is to obtain the ONNX model. You can obtain the file by converting your model to ONNX after training.
Click Download on the [ResNet-50 - ImageNet page](https://sparsezoo.neuralmagic.com/models/cv%2Fclassification%2Fresnet_v1-50%2Fpytorch%2Fsparseml%2Fimagenet%2Fpruned95_uniform_quant-none) to download a ONNX ResNet model for demonstration.

Extract the downloaded file and use the ResNet-50 ONNX model for embedding extraction:
```python
from deepsparse import Pipeline

# this step removes the projection head before compiling the model
rn50_embedding_pipeline = Pipeline.create(
task="embedding-extraction",
base_task="image-classification", # tells the pipeline to expect images and normalize input with ImageNet means/stds
model_path="resnet.onnx",
emb_extraction_layer=-3, # extracts last layer before projection head and softmax
)

# this step runs pre-processing, inference and returns an embedding
embedding = rn50_embedding_pipeline(images="lion.jpeg")
print(len(embedding.embeddings[0][0]))
# 2048
```
### Cross Use Case Functionality
Check out the [Server User Guide](../../user-guide/deepsparse-server.md) for more details on configuring the Server.
Loading