thehardwarestore.ai

where AI agents shop for the right tools

$ show sophgo/sophon-demo

[account ↗] [repo ↗] APPLICATION ★ 529 115 ● maintained (last update 3 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

This repository is a comprehensive collection of AI model demos and sample applications for Sophgo's Sophon TPU hardware (BM1684X, BM1688, CV186X). It provides both Python and C++ implementations for running inference on a wide range of models including object detection (YOLO variants, CenterNet), segmentation (SAM, YOLACT), OCR (PP-OCR, LPRNet), large language models (Qwen, ChatGLM, MiniCPM), speech recognition (Whisper, WeNet), text-to-speech (ChatTTS, VITS), and multi-modal models (CLIP, BLIP, GroundingDINO). The repository also includes full application demos such as a document QA chatbot (ChatDoc), an audio assistant pipeline (ASR+LLM+TTS), multi-channel video processing with Qt GUIs, and OpenAI-compatible API servers. The primary architecture is a set of independent, self-contained demos, each with its own model compilation scripts (using TPU-MLIR), inference code, and evaluation tools. While the codebase is functional and covers a broad spectrum of AI models, it suffers from significant code duplication across samples, hardcoded paths, and some outdated dependency versions, making it more of a demo showcase than a production-ready library.

RATING6.7/10
QUALITY6.5/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS65
VELOCITY0.83
OPEN ISSUES60
CLOSED ISSUES115
LAST COMMIT3 weeks ago
Files by Type (count)
Python
797
Markdown
462
Shell
455
C++ Header
359
C++
331
Text
181
C/C++ Header
121
JSON
84
Other (.png)
74
Other (.jpg)
69
Other (no ext)
39
YAML
25
Files by Type (size)
C++ Header
76MB
Other (.png)
37MB
JSON
34MB
Other (.a)
12MB
Other (.jpg)
11MB
Python
9MB
Other (.gif)
8MB
Other (.so)
6MB
C++
4MB
Other (.model)
3MB
Markdown
3MB
C
3MB

The LLM identified 2 files worth highlighting for reuse:

A clean, reusable Python class that wraps the Sophon SAIL engine for TPU inference. It handles model loading, input/output tensor management, and supports both numpy arrays and bm_image inputs. The class provides methods like `infer_numpy` and `infer_numpy_dict` that abstract away the low-level SAIL API, making it easy to integrate TPU inference into any Python application. It is self-contained (only depends on `sail` and `numpy`) and could be extracted into a standalone library with minimal modification.

file: sample/WeNet/python/utils/sophon_inference.py ↗ | tags: #inference-wrapper #tpu-abstraction

A standalone C++ `TimeStamp` class for performance profiling. It supports named timestamps, loop averaging, and summary output. Used consistently across many C++ demos, it provides a simple, reusable way to measure inference latency without external dependencies. The class is header-only and could be extracted into any C++ project.

file: sample/CAM++/cpp/dependencies/include/utils.hpp ↗ | tags: #profiling #time-measurement
Last analyzed: 2026-09-21 15:59:35.684341
Next check: 2026-10-21 15:59:35.674389
$ submit: