![logo_t](./images/hyperlpr_logo.png)
## HyperLPR3 - High Performance License Plate Recognition Framework.
#### [![1](https://badge.fury.io/py/hyperlpr3.svg "title")](https://pypi.org/project/hyperlpr3/)[![1](https://img.shields.io/pypi/pyversions/hyperlpr3.svg "title")](https://pypi.org/manage/project/hyperlpr3/releases/)[![](https://jitpack.io/v/HyperInspire/hyperlpr3-android-sdk.svg)](https://jitpack.io/#HyperInspire/hyperlpr3-android-sdk)
[中文文档](README_CH.md)
### Demo APP Installation
- Android APP:[Scan QR Code](http://fir.tunm.top/hyperlpr)
### Quick Installation
`python -m pip install hyperlpr3`
###### support:python3, Windows, Mac, Linux, Raspberry Pi。
###### 720p cpu real-time (st on MBP r15 2.2GHz haswell).
#### Quick Test
```bash
# image url
lpr3 sample -src https://koss.iyong.com/swift/v1/iyong_public/iyong_2596631159095872/image/20190221/1550713902741045679.jpg
# image path
lpr3 sample -src images/test_img.jpg -det high
```
#### How to Use
```python
# import opencv
import cv2
# import hyperlpr3
import hyperlpr3 as lpr3
# Instantiate object
catcher = lpr3.LicensePlateCatcher()
# load image
image = cv2.imread("images/test_img.jpg")
# print result
print(catcher(image))
```
#### Start the WebAPI service
```bash
# start server
lpr3 rest --port 8715 --host 0.0.0.0
```
Path to open SwaggerUI after startup:[http://localhost:8715/api/v1/docs](http://localhost:8715/api/v1/docs) View and test the online Identification API service:
![swagger_ui](./images/swagger-ui.png)
#### Q&A
Q:Whether the accuracy of android in the project is consistent with that of apk-demo?
A:Please compile or download the Android shared library from the release and copy it to Prj-Android for testing。
Q:Source of training data for license plates?
A:Since the license plate data used for training involves legal privacy and other issues, it cannot be provided in this project. Open more big data sets [CCPD](https://github.com/detectRecog/CCPD) registration dataset。
Q:Provision of training code?
A:The resources provide the old training code, and the training methods for HyperLPR3 will be sorted out and presented later。
#### Resources
- [HyperLPR3车牌识别-五分钟搞定: 中文车牌识别光速部署与使用](https://blog.csdn.net/weixin_40193776/article/details/129258107)
- [HyperLPR3车牌识别-Android-SDK光速部署与使用](https://blog.csdn.net/weixin_40193776/article/details/129394240)
- [HyperLPR3车牌识别-Linux/MacOS使用:C/C++库编译](https://blog.csdn.net/weixin_40193776/article/details/129295679)
- [HyperLPR3车牌识别-Android使用:SDK编译与部署](https://blog.csdn.net/weixin_40193776/article/details/129354938)
- To be added... Contributions welcome
#### Other Versions
- [HyperLPRv1](https://github.com/szad670401/HyperLPR/tree/v1)
- [HyperLPRv2](https://github.com/szad670401/HyperLPR/tree/v2)
### TODO
- Support for rapid deployment of WebApi services
- Support multiple license plates and double layers
- Support large Angle license plate
- Lightweight recognition model
### Specialty
- 720p faster, single core Intel 2.2G CPU (MaBook Pro 2015) average recognition time is less than 100ms
- End-to-end license plate recognition does not require character segmentation
- The recognition rate is high, and the accuracy of the entrance and exit scene is about 95%-97%
- Support cross-platform compilation and rapid deployment
### Matters Need Attention:
- The C++ and Python implementations of this project are separate
- When compiling C++ projects, OpenCV 4.0 and MNN 2.0 must be used, otherwise it will not compile
- Android project compilation ndk as far as possible to use version 21
### Python Dependency
- opencv-python (>3.3)
- onnxruntime (>1.8.1)
- fastapi (0.92.0)
- uvicorn (0.20.0)
- loguru (0.6.0)
- python-multipart
- tqdm
- requests
### Cross-platform support
#### Platform
- Linux: x86、Armv7、Armv8
- MacOS: x86
- Android: arm64-v8a、armeabi-v7a
#### Embedded Development Board
- Rockchip: rv1109rv1126(RKNPU)
### CPP Dependency
- Opencv 4.0 above
- MNN 2.0 above
### C/C++ Compiling Dependencies
Compiling C/C++ projects requires the use of third-party dependency libraries. After downloading the library, unzip it, and put it into the root directory (the same level as CMakeLists.txt) by copying or soft linking.[baidu drive](https://pan.baidu.com/s/1zfP2MSsG1jgxB_MjvpwZJQ) code: eu31
### Linux/Mac Shared Library Compilation
- Need to place or link dependencies in the project root (same level as CMakeLists.txt)
- We recommend you to compile OpenCV yourself and install it into the system. This can help reduce compilation errors caused by version mismatches and compiler issues with system dependencies. However, you can also try using the pre-compiled OpenCV static library we provide for compilation. To do this, you need to enable the **LINUX_USE_3RDPARTY_OPENCV** switch.
```bash
# execute the script
sh command/build_release_linux_share.sh
```
Compiled to the **build/linux/install/hyperlpr3** dir,Which contains:
- include - header file
- lib - shared dir
- resource - test-images and models dir
Copy the files you need into your project
### Linux/Mac Compiling the Demo
- You need to complete the previous compilation step and ensure it's successful. The compiled files will be located in the root directory: **build/linux/install/hyperlpr3**. You will need to manually copy them to the current directory.
- Go to the **Prj-Linux** folder
```bash
# go to Prj-linux
cd Prj-Linux
# exec sh
sh build.sh
```
The executable program is generated after compilation: **PlateRecDemo**,and Run the program
```bash
# go to build
cd build/
# first param models dir, second param image path
./PlateRecDemo ../hyperlpr3/resource/models/r2_mobile ../hyperlpr3/resource/images/test_img.jpg
```
### Linux/Mac Quick Use SDK Code Example
```C
// Load image
cv::Mat image = cv::imread(image_path);
// Create a ImageData
HLPR_ImageData data = {0};
data.data = image.ptr<uint8_t>(0); // Setting the image data flow
data.width = image.cols; // Setting the image width
data.height = image.rows; // Setting the image height
data.format = STREAM_BGR; // Setting the current image encoding format
data.rotation = CAMERA_ROTATION_0; // Setting the current image corner
// Create a Buffer
P_HLPR_DataBuffer buffer = HLPR_CreateDataBuffer(&data);
// Configure license plate recognition parameters
HLPR_ContextConfiguration configuration = {0};
configuration.models_path = model_path; // Model folder path
configuration.max_num = 5; // Maximum number of license plates
configuration.det_level = DETECT_LEVEL_LOW; // Level of detector
configuration.use_half = false;
configuration.nms_threshold = 0.5f; // Non-maxima suppress the confidence threshold
configuration.rec_confidence_threshold = 0.5f; // License plate number text threshold
configuration.box_conf_threshold = 0.30f; // Detector threshold
configuration.threads = 1;
// Instantiating a Context
P_HLPR_Context ctx = HLPR_CreateContext(&configuration);
// Query the Context state
HREESULT ret = HLPR_ContextQueryStatus(ctx);
if (ret != HResultCode::Ok) {
printf("create error.\n");
return -1;
}
HLPR_PlateResultList results = {0};
// Execute LPR
HLPR_ContextUpdateStream(ctx, buffer, &results);
for (int i = 0; i < results.plate_size; ++i) {
// Getting results
std::string type;
if (results.plates[i].type == HLPR_PlateType::PLATE_TYPE_UNKNOWN) {
type = “Unknown";
} else {
type = TYPES[results.plates[i].type];
}
printf("<%d> %s, %s, %f\n", i + 1, type.c_str(),
results.plates[i].code, results.plates[i].text_confidence);
}
// Release Buffer
HLPR_ReleaseDataBuffer(buffer);
// Release Context
HLPR_ReleaseContext(ctx);
```
### Android: Compile the Shared Library
- The first step is to install
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
毕设&课程作业_基于深度学习高性能中文车牌识别.zip (179个子文件)
app-release.apk 15.03MB
gradlew.bat 3KB
hyper_lpr_sdk.cc 5KB
inference_helper.cpp 17KB
inference_helper_mnn.cpp 14KB
hyperlpr_native.cpp 9KB
hyper_lpr_context.cpp 9KB
camera_buffer.cpp 8KB
recognition_engine.cpp 5KB
det_arch.cpp 5KB
sample_split_model.cpp 4KB
classification_engine.cpp 3KB
plate_detector.cpp 3KB
mnn_adapter.cpp 3KB
det_header.cpp 3KB
det_backbone.cpp 3KB
plate_recognition.cpp 3KB
plate_rec_demo.cpp 3KB
sample_capi.cpp 2KB
test_classification.cpp 2KB
test_recognition.cpp 2KB
sample_context.cpp 1KB
test_detection.cpp 1KB
plate_classification.cpp 1KB
test_settings.cpp 386B
test_main.cpp 178B
Dockerfile 252B
.gitignore 346B
.gitignore 225B
.gitignore 67B
.gitignore 17B
.gitignore 12B
.gitignore 6B
build.gradle 1KB
build.gradle 458B
settings.gradle 335B
gradlew 6KB
hyper_lpr_sdk.h 11KB
inference_helper.h 9KB
utils.h 5KB
plate_det_common.h 2KB
inference_helper_mnn.h 2KB
hyper_lpr_context.h 2KB
jni_utils.h 2KB
inference_helper_log.h 2KB
log.h 2KB
recognition_engine.h 1KB
mnn_adapter.h 1KB
hyper_lpr_common.h 1KB
classification_engine.h 1KB
camera_buffer.h 1KB
plate_recognition.h 1KB
det_arch.h 1KB
det_header.h 1KB
plate_detector.h 1KB
test_settings.h 1KB
det_backbone.h 931B
plate_classification.h 860B
configuration.h 810B
plate_recognition_tokenize.h 771B
recognition_commom.h 619B
hyperlpr3.h 445B
hyper_lpr_sdk_internal.h 398B
all.h 281B
all.h 271B
plate_cls_common.h 267B
all.h 254B
all.h 253B
basic_types.h 252B
all.h 230B
all.h 184B
all.h 176B
doc.h 121B
version.h 102B
catch.hpp 642KB
gradle-wrapper.jar 58KB
CameraPreviews.java 7KB
MainActivity.java 7KB
CameraActivity.java 2KB
ExampleInstrumentedTest.java 772B
ExampleUnitTest.java 390B
2.jpg 1.98MB
test_img.jpg 385KB
1.jpg 30KB
pre.jpg 27KB
align.jpg 13KB
_1_皖KD01833.jpg 7KB
1.jpg 6KB
5.jpg 5KB
_0_津B6H920.jpg 5KB
_8_冀D5L690.jpg 4KB
3.jpg 4KB
a.jpg 4KB
_6_蒙B023H6.jpg 4KB
pad.jpg 2KB
output-metadata.json 383B
hyperlpr3Tests.m 806B
README.md 11KB
README_CH.md 10KB
hyperlpr3.md 271B
共 179 条
- 1
- 2
资源评论
学术菜鸟小晨
- 粉丝: 1w+
- 资源: 4928
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功