Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ sidebar_position: 15

## DX-M1 SDK

- [dx_com_M1_v1.60.1](https://dl.radxa.com/aicore/dx_m1/dx_com_M1_v1.60.1.tar.gz)
- [DX_Tron_v0.0.8](https://dl.radxa.com/aicore/dx_m1/sdk/DX_Tron_v0.0.8.zip)
**DX-COM**

- [dx_com_M1_v2.1.0](https://dl.radxa.com/aicore/dx_m1/sdk/dx_com_M1_v2.1.0.tar.gz)

**DX-Tron**

- [**Linux:** DXTron-2.0.0.AppImage](https://dl.radxa.com/aicore/dx_m1/sdk/DXTron-2.0.0.AppImage)
- [**Windows:** DXTron Setup 2.0.0.exe](https://dl.radxa.com/aicore/dx_m1/sdk/DXTron%20Setup%202.0.0.exe)

## Reference Documents

- [Radxa AICore DX-M1 Product Brief (English)](https://dl.radxa.com/aicore/dx_m1/radxa_aicore_dx_m1_product_brief_en_revision_1.0.pdf)
- [Radxa AICore DX-M1 Product Brief (Chinese)](https://dl.radxa.com/aicore/dx_m1/radxa_aicore_dx_m1_product_brief_zh_revision_1.0.pdf)
- [Radxa AI Core DX-M1 Product Brief (English)](https://dl.radxa.com/aicore/dx_m1/radxa_aicore_dx_m1_product_brief_en_revision_1.0.pdf)
- [Radxa AI Core DX-M1 Product Brief (Chinese)](https://dl.radxa.com/aicore/dx_m1/radxa_aicore_dx_m1_product_brief_zh_revision_1.0.pdf)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ sidebar_position: 3

# DX-M1 SDK

Mainly introduces the application development for AI hardware acceleration using DX-M1 SDK on Radxa AICore DX-M1
This section introduces application development for AI hardware acceleration on the Radxa AI Core DX-M1 using the DX-M1 SDK.

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ sidebar_position: 3

# DX-SIM Inference Simulator

## Introduction
## Overview

**DX-SIM (Model Simulator)** simulates the DEEPX NPU hardware functions on an x86 PC, enabling DXNN model inference simulation on an x86 PC.
**DX-SIM (model simulator)** simulates DEEPX NPU hardware behavior on an x86 PC, enabling you to run inference for DXNN models on an x86 PC.

## Installation

Download the DX-SIM installation package from the DX-M1 SDK [Resources Download](../download.md) page and extract it.
Download the DX-SIM package from the DX-M1 SDK [Downloads](../download.md) page and extract it.

<NewCodeBlock tip="X86 PC" type="PC">

Expand All @@ -21,7 +21,7 @@ tar -xvf dx_simulator_v2.14.5.tar.gz -C dx_simulator && cd dx_simulator

</NewCodeBlock>

Install DX-SIM:
Install DX-SIM

<NewCodeBlock tip="X86 PC" type="PC">

Expand All @@ -42,23 +42,23 @@ pip3 install dx_simulator-2.14.5-cp311-cp311-linux_x86_64.whl --force-reinstall

### Simulator Class

- Use the `Simulator` class to initialize the simulator instance.
- Use the `Simulator` class to initialize the simulator.

```python
from dx_simulator import Simulator

simulator = Simulator(
model_path="path/to/graph.dxnn",
use_gpu=True, # If you want to run the model with GPU.
use_gpu=True, # If you want to run the model with gpu.
)
```

### Inference Simulation
### Simulated Inference

Use the `Simulator.run()` function to perform inference simulation.
Use `Simulator.run()` for simulated inference.

- `output_names` is the list of model output names.
- `input_feed` is a dictionary that contains model input names and input data.
- `output_names` is a list of model output names.
- `input_feed` is a dictionary that maps model input names to input data.

```bash
outputs = simulator.run(
Expand All @@ -67,9 +67,9 @@ outputs = simulator.run(
)
```

### Generating Reference Data
### Generate Reference Data

If you want to generate reference data to compare with the runtime output on NPU, refer to the following method:
If you want to generate reference data for comparison with the NPU runtime outputs, use the following method.

```python
from dx_simulator import Simulator
Expand All @@ -93,14 +93,14 @@ simulator.make_gt_with_image_file(

### Image Preprocessing

When using the simulator for inference, the input data is the same as on NPU and **must be of type `uint8`**. Therefore, pay attention to the following points during preprocessing:
When running inference with the simulator, the input data requirements are the same as for the NPU: **the input must be `uint8`**. Therefore, pay attention to the following during preprocessing:

- The simulator input data must be of type `uint8`.
- Do not use operations such as `Mul` or `Add` (i.e., multiplication or addition) in the preprocessing stage; otherwise, the data format may no longer satisfy the `uint8` requirement.
- Similar operations (including `Normalize`) should be specified in the configuration file and handled on the **NPU side**.
- After preprocessing, you **must convert the data type to `np.uint8`** to ensure the simulator can accept the input correctly.
- The simulator input data must be `uint8`.
- Do not use operations such as `Mul` or `Add` (i.e., multiplication/addition) during preprocessing; otherwise the data format will not meet the `uint8` requirement.
- Similar operations (including `Normalize`) should be specified in the configuration file and handled **on the NPU side**.
- After preprocessing, you **must cast to `np.uint8`** to ensure the simulator can accept the input correctly.

Below is an example code snippet showing how to build the preprocessing pipeline before feeding data into the simulator:
Below is an example snippet showing how to build the preprocessing pipeline before running the simulator:

```python
import cv2
Expand All @@ -118,7 +118,7 @@ outputs = simulator.run(
)
```

### Simulator Class Member Functions
### Simulator Class Methods

```bash
from dx_simulator import Simulator
Expand All @@ -131,7 +131,7 @@ output_metadata = simulator.get_outputs() # Return model's output names

### Reference Code

For more examples of using DX-SIM, please refer to the `example` directory in the DX-SIM SDK:
For more DX-SIM usage examples, refer to the sample code under `example` in the DX-SIM SDK.

```bash
.
Expand Down
Loading