https://github.com/dkurt/hair_segmentation
Hair recoloring on RISC-V with OpenCV
https://github.com/dkurt/hair_segmentation
deep-learning licheepi mangopi-mq-pro mediapipe opencv risc-v riscv64 rvv tflite
Last synced: 20 days ago
JSON representation
Hair recoloring on RISC-V with OpenCV
- Host: GitHub
- URL: https://github.com/dkurt/hair_segmentation
- Owner: dkurt
- Created: 2023-04-17T09:07:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-19T19:03:28.000Z (over 2 years ago)
- Last Synced: 2025-09-15T14:45:11.710Z (22 days ago)
- Topics: deep-learning, licheepi, mangopi-mq-pro, mediapipe, opencv, risc-v, riscv64, rvv, tflite
- Language: Python
- Homepage:
- Size: 93.8 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This repository contains a simple Python script which runs Mediapipe's hair segmentation model using OpenCV on RISC-V CPU.
### How to start
1. Download a compiler: [Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.1-20220906.tar.gz](https://occ.t-head.cn/community/download?id=4090445921563774976) and put to `opencv_riscv64` folder without unpacking.
2. Build OpenCV:
```bash
docker build -t opencv opencv_riscv64
docker run -v $(pwd):/mnt opencv sh -c "cp *.tar.gz /mnt"
```3. Download deep learning [model](https://storage.googleapis.com/mediapipe-assets/hair_segmentation.tflite?generation=1661875756623461)
4. Start a telegram bot:
```bash
python bot.py --token=xxx
```### Performance
HW: Sipeed Lichee RV Dock (Allwinner D1 aka XuanTie C906 CPU)
OS: [20211230_LicheeRV_debian_d1_hdmi_8723ds](https://mega.nz/folder/lx4CyZBA#PiFhY7oSVQ3gp2ZZ_AnwYA/folder/xtxkABIB)
| input | no RVV | RVV |
|---|---|---|
| 512x512 | 3.5 seconds | 2.35 seconds (x1.48) |
![]()