---
title: "Get pretrained model"
method: GET
path: "/api/{projectId}/pretrained-model"
tags: ["Learn"]
---

# Get pretrained model

`GET /api/{projectId}/pretrained-model`

## Request

- Base URL: `https://studio.edgeimpulse.com/v1`
- URL: `https://studio.edgeimpulse.com/v1/api/{projectId}/pretrained-model`
- Auth: one of:
  - API key in header `x-api-key`
  - API key in cookie `jwt`
  - API key in header `x-jwt-token`
  - OAuth 2
    - Authorization code: `/v1/oauth/authorize`
    - Client credentials
    - Implicit: `/v1/oauth/authorize`
    - Password
    - Token URL: `/v1/oauth/token`
- TypeScript: <https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/docs/api/:projectId/pretrained-model/get.ts> (a function with typed inputs; its response is checked against the schema)

Receive info back about the earlier uploaded pretrained model (via `uploadPretrainedModel`) input/output tensors. If you want to deploy a pretrained model from the API, see `startDeployPretrainedModelJob`.

## Path parameters

- `projectId` integer, required

## Query parameters

- `impulseId` integer

## Response `200`

OK

- GetPretrainedModelResponse
  - `success` boolean, required: Whether the operation succeeded
  - `error` string: Optional error description (set if 'success' was false)
  - `specificDeviceSelected` boolean, required: Whether a specific device was selected for performance profiling
  - `availableModelTypes` KerasModelTypeEnum[], required: The types of model that are available
  - `model` object
    - `fileName` string, required
    - `profileInfo` object
      - `float32` ProfileModelInfo
        - `variant` 'int8' | 'float32' | 'akida', required
        - `device` string, required
        - `tfliteFileSizeBytes` integer, required
        - `isSupportedOnMcu` boolean, required
        - `memory` object
          - `tflite` ProfileModelInfoMemoryDetails
            - `ram` integer, required: Estimated amount of RAM required by the model, measured in bytes
            - `rom` integer, required: Estimated amount of ROM required by the model, measured in bytes
            - `arenaSize` integer, required: Estimated arena size required for model inference, measured in bytes
          - `eon` ProfileModelInfoMemoryDetails
            - `ram` integer, required: Estimated amount of RAM required by the model, measured in bytes
            - `rom` integer, required: Estimated amount of ROM required by the model, measured in bytes
            - `arenaSize` integer, required: Estimated arena size required for model inference, measured in bytes
          - `eonRamOptimized` ProfileModelInfoMemoryDetails
            - `ram` integer, required: Estimated amount of RAM required by the model, measured in bytes
            - `rom` integer, required: Estimated amount of ROM required by the model, measured in bytes
            - `arenaSize` integer, required: Estimated arena size required for model inference, measured in bytes
        - `timePerInferenceMs` integer
        - `mcuSupportError` string
        - `customMetrics` KerasCustomMetric[], required: Custom, device-specific performance metrics
          - `name` string, required: The name of the metric
          - `value` string, required: The value of this metric for this model type
        - `hasPerformance` boolean, required: If false, then no metrics are available for this target
        - `profilingError` string: Specific error during profiling (e.g. model not supported)
      - `int8` ProfileModelInfo
        - `variant` 'int8' | 'float32' | 'akida', required
        - `device` string, required
        - `tfliteFileSizeBytes` integer, required
        - `isSupportedOnMcu` boolean, required
        - `memory` object
          - `tflite` ProfileModelInfoMemoryDetails
            - `ram` integer, required: Estimated amount of RAM required by the model, measured in bytes
            - `rom` integer, required: Estimated amount of ROM required by the model, measured in bytes
            - `arenaSize` integer, required: Estimated arena size required for model inference, measured in bytes
          - `eon` ProfileModelInfoMemoryDetails
            - `ram` integer, required: Estimated amount of RAM required by the model, measured in bytes
            - `rom` integer, required: Estimated amount of ROM required by the model, measured in bytes
            - `arenaSize` integer, required: Estimated arena size required for model inference, measured in bytes
          - `eonRamOptimized` ProfileModelInfoMemoryDetails
            - `ram` integer, required: Estimated amount of RAM required by the model, measured in bytes
            - `rom` integer, required: Estimated amount of ROM required by the model, measured in bytes
            - `arenaSize` integer, required: Estimated arena size required for model inference, measured in bytes
        - `timePerInferenceMs` integer
        - `mcuSupportError` string
        - `customMetrics` KerasCustomMetric[], required: Custom, device-specific performance metrics
          - `name` string, required: The name of the metric
          - `value` string, required: The value of this metric for this model type
        - `hasPerformance` boolean, required: If false, then no metrics are available for this target
        - `profilingError` string: Specific error during profiling (e.g. model not supported)
      - `table` ProfileModelTable, required: Performance for a range of device types. Note that MPU is referred to as CPU in Studio, as MPU and CPU are treated equivalent for performance estimation.
        - `variant` 'int8' | 'float32', required
        - `lowEndMcu` ProfileModelTableMcu, required
          - `description` string, required
          - `timePerInferenceMs` integer
          - `memory` object
            - `tflite` object
              - …
            - `eon` object
              - …
            - `eonRamOptimized` object
              - …
          - `supported` boolean, required
          - `mcuSupportError` string
        - `highEndMcu` ProfileModelTableMcu, required
          - `description` string, required
          - `timePerInferenceMs` integer
          - `memory` object
            - `tflite` object
              - …
            - `eon` object
              - …
            - `eonRamOptimized` object
              - …
          - `supported` boolean, required
          - `mcuSupportError` string
        - `highEndMcuPlusAccelerator` ProfileModelTableMcu, required
          - `description` string, required
          - `timePerInferenceMs` integer
          - `memory` object
            - `tflite` object
              - …
            - `eon` object
              - …
            - `eonRamOptimized` object
              - …
          - `supported` boolean, required
          - `mcuSupportError` string
        - `mpu` ProfileModelTableMpu, required
          - `description` string, required
          - `timePerInferenceMs` integer
          - `rom` number
          - `supported` boolean, required
        - `gpuOrMpuAccelerator` ProfileModelTableMpu, required
          - `description` string, required
          - `timePerInferenceMs` integer
          - `rom` number
          - `supported` boolean, required
    - `inputs` PretrainedModelTensor[], required
      - `dataType` 'int8' | 'uint8' | 'float32', required
      - `name` string, required
      - `shape` integer[], required
      - `quantizationScale` number
      - `quantizationZeroPoint` number
    - `outputs` PretrainedModelTensor[], required
      - `dataType` 'int8' | 'uint8' | 'float32', required
      - `name` string, required
      - `shape` integer[], required
      - `quantizationScale` number
      - `quantizationZeroPoint` number
    - `profileJobId` integer: If this is set, then we're still profiling this model. Subscribe to job updates to see when it's done (afterward the metadata will be updated).
    - `profileJobFailed` boolean: If this is set, then the profiling job failed (get the status by getting the job logs for 'profilingJobId').
    - `supportsTFLite` boolean
  - `modelInfo` object
    - `input` union, required
      - DeployPretrainedModelInputTimeSeries
        - `inputType` 'time-series', required
        - `frequencyHz` number, required
        - `windowLengthMs` integer, required
      - DeployPretrainedModelInputAudio
        - `inputType` 'audio', required
        - `frequencyHz` number, required
      - DeployPretrainedModelInputImage
        - `inputType` 'image', required
        - `inputScaling` '0..1' | '-1..1' | '-128..127' | '0..255' | 'torch' | 'bgr-subtract-imagenet-mean': Normalization that is applied to images. If this is not set then 0..1 is used. "0..1" gives you non-normalized pixels between 0 and 1. "-1..1" gives you non-normalized pixels between -1 and 1. "0..255" gives you non-normalized pixels between 0 and 255. "-128..127" gives you non-normalized pixels between -128 and 127. "torch" first scales pixels between 0 and 1, then applies normalization using the ImageNet dataset (same as `torchvision.transforms.Normalize()`). "bgr-subtract-imagenet-mean" scales to 0..255, reorders pixels to BGR, and subtracts the ImageNet mean from each channel.
        - `resizeMode` 'squash' | 'fit-short' | 'fit-long' | 'crop': Input images are resized automatically before training and testing, to match the impulse input shape. This determines the resize mode used when the aspect ratio of the input data is different to the aspect ratio of the impulse.
      - DeployPretrainedModelInputOther
        - `inputType` 'other', required
    - `model` union, required
      - DeployPretrainedModelModelClassification
        - `modelType` 'classification', required
        - `labels` string[], required
        - `addSoftmax` boolean
      - DeployPretrainedModelModelRegression
        - `modelType` 'regression', required
      - DeployPretrainedModelModelObjectDetection
        - `modelType` 'object-detection', required
        - `labels` string[], required
        - `lastLayer` 'mobilenet-ssd' | 'fomo' | 'yolov2-akida' | 'yolov5' | 'yolov5v5-drpai' | 'yolox' | 'yolov7' | 'yolo-pro' | 'tao-retinanet' | 'tao-ssd' | 'tao-yolov3' | 'tao-yolov4' | 'yolov11' | 'yolov11-abs' | 'paddleocr-detector' | 'qc-face-det-lite' | 'qc-yolox', required
        - `minimumConfidence` number, required: Deprecated: use thresholdValues instead. Threshold for objects (f.e. 0.3).
        - `thresholdValues` object: All configured thresholds for the current model. Valid keys are 'min_score' (object detection models, all but paddleocr-detector); 'min_score_pixel', 'min_score_box', 'unclip_ratio' (paddleocr-detector).
      - DeployPretrainedModelModelFreeform
        - `modelType` 'freeform', required
      - DeployPretrainedModelModelAnomaly
        - `modelType` 'anomaly', required
      - DeployPretrainedModelModelVisualAnomaly
        - `modelType` 'visual-anomaly', required
        - `thresholdValues` object: All configured thresholds for the current model. Valid keys are 'min_anomaly_score' and 'anomaly_scoring_aggregation_method'.

---

[API](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api.md) - [All operations](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/llms.txt) - [OpenAPI document](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/revisions/e2a976d38427?raw)
