shreyajn commited on
Commit
d99fb53
·
verified ·
1 Parent(s): c9a0402

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +11 -28
README.md CHANGED
@@ -39,7 +39,7 @@ More details on model performance across various devices, can be found
39
 
40
  | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
41
  | ---|---|---|---|---|---|---|---|
42
- | Samsung Galaxy S23 Ultra (Android 13) | Snapdragon® 8 Gen 2 | TFLite | 5.108 ms | 1 - 4 MB | FP16 | NPU | [DDRNet23-Slim.tflite](https://huggingface.co/qualcomm/DDRNet23-Slim/blob/main/DDRNet23-Slim.tflite)
43
 
44
 
45
 
@@ -114,29 +114,13 @@ in memory using the `jit.trace` and then call the `submit_compile_job` API.
114
  import torch
115
 
116
  import qai_hub as hub
117
- from qai_hub_models.models.ddrnet23_slim import Model
118
 
119
  # Load the model
120
- torch_model = Model.from_pretrained()
121
 
122
  # Device
123
  device = hub.Device("Samsung Galaxy S23")
124
 
125
- # Trace model
126
- input_shape = torch_model.get_input_spec()
127
- sample_inputs = torch_model.sample_inputs()
128
-
129
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
130
-
131
- # Compile model on a specific device
132
- compile_job = hub.submit_compile_job(
133
- model=pt_model,
134
- device=device,
135
- input_specs=torch_model.get_input_spec(),
136
- )
137
-
138
- # Get target model to run on-device
139
- target_model = compile_job.get_target_model()
140
 
141
  ```
142
 
@@ -149,10 +133,10 @@ provisioned in the cloud. Once the job is submitted, you can navigate to a
149
  provided job URL to view a variety of on-device performance metrics.
150
  ```python
151
  profile_job = hub.submit_profile_job(
152
- model=target_model,
153
- device=device,
154
- )
155
-
156
  ```
157
 
158
  Step 3: **Verify on-device accuracy**
@@ -162,12 +146,11 @@ on sample input data on the same cloud hosted device.
162
  ```python
163
  input_data = torch_model.sample_inputs()
164
  inference_job = hub.submit_inference_job(
165
- model=target_model,
166
- device=device,
167
- inputs=input_data,
168
- )
169
-
170
- on_device_output = inference_job.download_output_data()
171
 
172
  ```
173
  With the output of the model, you can compute like PSNR, relative errors or
 
39
 
40
  | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
41
  | ---|---|---|---|---|---|---|---|
42
+ | Samsung Galaxy S23 Ultra (Android 13) | Snapdragon® 8 Gen 2 | TFLite | 5.138 ms | 1 - 3 MB | FP16 | NPU | [DDRNet23-Slim.tflite](https://huggingface.co/qualcomm/DDRNet23-Slim/blob/main/DDRNet23-Slim.tflite)
43
 
44
 
45
 
 
114
  import torch
115
 
116
  import qai_hub as hub
117
+ from qai_hub_models.models.ddrnet23_slim import
118
 
119
  # Load the model
 
120
 
121
  # Device
122
  device = hub.Device("Samsung Galaxy S23")
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
  ```
126
 
 
133
  provided job URL to view a variety of on-device performance metrics.
134
  ```python
135
  profile_job = hub.submit_profile_job(
136
+ model=target_model,
137
+ device=device,
138
+ )
139
+
140
  ```
141
 
142
  Step 3: **Verify on-device accuracy**
 
146
  ```python
147
  input_data = torch_model.sample_inputs()
148
  inference_job = hub.submit_inference_job(
149
+ model=target_model,
150
+ device=device,
151
+ inputs=input_data,
152
+ )
153
+ on_device_output = inference_job.download_output_data()
 
154
 
155
  ```
156
  With the output of the model, you can compute like PSNR, relative errors or