GoogLeNet Example
This document describes using the QAI AppBuilder Python API to run inference with the GoogLeNet image classification model on the Qualcomm® Hexagon™ Processor (NPU).
Supported devices
| Device | SoC |
|---|---|
| Dragon Q6A | QCS6490 |
| Dragon Q8B | SC8280XP |
| Fogwise® AIRbox Q900 | QCS9075 |
Install QAI AppBuilder
-
Install QAI AppBuilder by following the QAI AppBuilder installation guide.
-
Configure ADSP environment variables as described in Create ADSP environment variables.
Run the sample
Install dependencies
Install sample dependencies in the activated virtual environment:
pip3 install requests tqdm qai-hub py3-wget Pillow torch torchvision opencv-python-headless
Run the script
-
Enter the upstream samples directory
Devicecd qai-appbuilder/samples
Run inference (Linux requires --chipset; the first run downloads dog.jpg, labels, and the model)
If the auto-downloaded dog.jpg is empty or corrupt, replace it with a valid local image or pass --image /path/to/image.jpg.
- QCS6490
- SC8280XP
- QCS9075
python3 ComputerVision/Image_Classification/googlenet/googlenet.py --chipset 6490
SC8280XP and QCS6490 both use Hexagon V68. Use --chipset 6490 when downloading models.
python3 ComputerVision/Image_Classification/googlenet/googlenet.py --chipset 6490
python3 ComputerVision/Image_Classification/googlenet/googlenet.py --chipset 9075
Expected result
On Dragon Q6A (--chipset 6490), the default test image produces output similar to:
Top 5 predictions for image:
Samoyed 0.9282982349
West Highland White Terrier 0.0102122389
Pomeranian 0.0064557223
Pyrenean Mountain Dog 0.0059806537
Chow Chow 0.0051328284
HTP / FastRPC WARNING lines may appear and can be ignored when inference succeeds.
Launcher alternative:
python3 run_inference.py --model googlenet --args "--chipset 6490"