Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
gezhaoyou committed Jan 30, 2024
1 parent c28a292 commit 73cbbe0
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 38 deletions.
65 changes: 31 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,34 @@
<p align="center">
<a href="https://github.com/pixpark/gpupixel/stargazers"><img alt="GPUPixel Stars" src="https://img.shields.io/github/stars/pixpark/gpupixel?style=social"/></a>
<a href="https://github.com/pixpark/gpupixel/releases/latest"><img alt="GPUPixel Release" src="https://img.shields.io/github/v/release/pixpark/gpupixel"/></a>
<a href="#"><img alt="GPUPixel Stars" src="https://img.shields.io/badge/Platform-iOS_%7C%20macOS%20%7C%20Android-red"/></a>
<a href="#"><img alt="GPUPixel Stars" src="https://img.shields.io/badge/Platform-iOS_%7C_Android_%7C_Mac_%7C_Win_%7C_Linux-red"/></a>
<a href="https://github.com/pixpark/gpupixel/blob/main/LICENSE"><img alt="GPUPixel Stars" src="https://img.shields.io/github/license/pixpark/gpupixel"/></a>
</p>

---


> 🎉🎉🎉 GPUPixel has added support for the Windows and Linux from [v1.1.0](https://github.com/pixpark/gpupixel/releases/tag/1.1.0), and now it is fully cross-platform supported: iOS | Android | Mac | Win | Linux 👏🏻👏🏻
[GPUPixel]() @ [PixPark](https://github.com/pixpark)
> 👏🏻👏🏻 GPUPixel has added support for the **Windows** and **Linux** from [v1.1.0](https://github.com/pixpark/gpupixel/releases/tag/1.1.0). And now it is fully cross-platform supported: **iOS | Android | Mac | Win | Linux** 🎉🎉🎉
## Introduction
⛰️ GPUPixel is a high-performance image and video AI beauty effect library written in C++11, Extremely easy to compile and integrate, with a very small library size.

🔑 It is GPU-based and comes with built-in beauty effects filters that can achieve commercial-grade results.

🔌 It supports platforms including `iOS`, `Android`, `Mac`, `Win`, `Linux` and it can theoretically be ported to any platform that supports OpenGL/ES.
🔌 It supports platforms including `iOS`, `Android`, `Mac`, `Win` and `Linux`. It can theoretically be ported to any platform that supports OpenGL/ES.

>💡 The face key points detection currently utilizes the [Face++](https://www.faceplusplus.com.cn/) library, but it will be replaced with either **[VNN](https://github.com/joyycom/VNN)** or **[NCNN](https://github.com/Tencent/ncnn)** in the future.
> The supported versions for Linux and Windows is expected to be completed before the Chinese 2024 New Year.
## Effects Preview

👉 **Video: <a href="https://youtu.be/9BY1Qx1NEPs" target="_blank">YouTube</a> | <a href="https://www.bilibili.com/video/BV1xQ4y1L7Fh/?share_source=copy_web&vd_source=46adcb1014fa989cfcbb4cc1e866831e" target="_blank">BiliBili</a>**


| **Origin** | **Smooth** | **White** | **ThinFace** |
| :---------------------------------------------: | :-----------------------------------------------: | :----------------------------------------------: | :-----------------------------------------------: |
| <img src="./docs/image/origin.gif" width="180"> | <img src="./docs/image/smooth.gif" width="180"> | <img src="./docs/image/white.gif" width="180"> | <img src="./docs/image/thinface.gif" width="180"> |
| <img src="./docs/image/origin.gif" width="180px"> | <img src="./docs/image/smooth.gif" width="180px"> | <img src="./docs/image/white.gif" width="180px"> | <img src="./docs/image/thinface.gif" width="180px"> |
| **BigEye** | **Lipstick** | **Blusher** | **ON-OFF** |
| <img src="./docs/image/bigeye.gif" width="180"> | <img src="./docs/image/lipstick.gif" width="180"> | <img src="./docs/image/blusher.gif" width="180"> | <img src="./docs/image/on-off.gif" width="180"> |
| <img src="./docs/image/bigeye.gif" width="180px"> | <img src="./docs/image/lipstick.gif" width="180px"> | <img src="./docs/image/blusher.gif" width="180px"> | <img src="./docs/image/on-off.gif" width="180px"> |

## Architecture
![](./docs/image/arch-en.jpg)
Expand Down Expand Up @@ -92,23 +88,22 @@ This table compares the features supported by **GPUPixel** and **GPUImage**:
| Time Taken | 6ms | 5ms | - | - | - |


## Library Size
## Lib Size

| | iOS(.framework) | MacOS(.framework) | Android(.aar) |
| :---: | :-------------: | :---------------: | :-----------: |
| Size | 2.4 MB | 2.6 MB | 2.1 MB |


## Before You Start
Star us on GitHub, and be instantly notified for new releases!
- Website
- Docs
- Deployment Docs
- FAQ
⭐️ Star us on GitHub, and be instantly notified for new releases!

## Quick Start
### How to Build
Compile using CMake frome v1.1.0. Please search for instructions on how to install and configure CMake.
The generated libraries and applications will be located in the "output" directory of the project's root folder.
### 🌰 How to Build
Compile using CMake frome v1.1.0. Please search for instructions on how to install and configure CMake.

The generated libraries and app will be located in the "output" directory of the project's root folder.

### iOS
```shell
cd src
Expand Down Expand Up @@ -140,10 +135,10 @@ cmake --build . --config Debug
```

### Android
1. Open the directory `src/android/java` in Android Studio
Open the directory `src/android/java` in Android Studio.

### Windows
You need install and config Cmake and MinGW64
You need install and config Cmake and MinGW64 by yourself.
```shell
cd src
mkdir build
Expand All @@ -155,12 +150,12 @@ cmake -G "MinGW Makefiles" ..
# Build
mingw32-make
```
### Linux (only test on ubuntu 22.04 lts)
### Linux (Test on ubuntu)

```shell
# install cmake
sudo apt-get install cmake pkg-config
# install glfw lib
# install dependent lib
sudo apt-get install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev libglfw3-dev

# start build
Expand All @@ -176,20 +171,21 @@ make
```
---

### App demo
### 🌵 App demo
### iOS
Refer to `examples/ios`
### Mac
Refer to `examples/mac`
### Android
Refer to `examples/android` or `src/android/java`
### Window and Linux
Refer to `examples/desktop`
Refer to `examples/desktop`

The compilation method is the same as compiling the library.

## How to Use
## 🏂 How to Use

**`.h` file**
**Declear filters**

```c++
// video data input
Expand All @@ -199,7 +195,7 @@ std::shared_ptr<FaceBeautyFilter> face_beauty_filter_;
// video data output
std::shared_ptr<TargetRawDataOutput> target_raw_output_;
```
**Create Filter, `.cpp` file**
**Create and link filters**

```c++
gpupixel::GPUPixelContext::getInstance()->runSync([&] {
Expand All @@ -210,11 +206,12 @@ std::shared_ptr<TargetRawDataOutput> target_raw_output_;
face_beauty_filter_ = FaceBeautyFilter::create();

// Add filter
source_raw_input_->addTarget(face_beauty_filter_)->addTarget(target_raw_output_);
source_raw_input_->addTarget(face_beauty_filter_)
->addTarget(target_raw_output_);
}
```
**Input Image Data I420 or RGBA**
**Input YUV420P or RGBA**
```c++
// ...
Expand Down Expand Up @@ -261,17 +258,17 @@ target_raw_output_->setPixelsCallbck([=](const uint8_t *data,
// Output data callbck
```
## Star History
## 🚙 Star History
[![Star History Chart](https://api.star-history.com/svg?repos=pixpark/gpupixel&type=Date)](https://star-history.com/#pixpark/gpupixel&Date)
## Contributing
Welcome to contribute code🙏🏻.
## 🍒 Contributing
Welcome to contribute code 👏🏻.
At the same time, please consider supporting Dify by sharing it on social media and at events and conferences.
At the same time, please consider supporting GPUPixel by sharing it on social media and at events and conferences.
## Acknowledgement
## 📔Acknowledgement
### Reference Project
1. [GPUImage](https://github.com/BradLarson/GPUImage)
2. [CainCamera](https://github.com/CainKernel/CainCamera)
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/filter/beauty_face_unit_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ bool BeautyFaceUnitFilter::init() {
return false;
}

grayImage_ = SourceImage::create(Util::getResourcePath("lookUpGray.png"));
originImage_ = SourceImage::create(Util::getResourcePath("lookUpOrigin.png"));
skinImage_ = SourceImage::create(Util::getResourcePath("lookUpSkin.png"));
customImage_ = SourceImage::create(Util::getResourcePath("lookup2.png"));
grayImage_ = SourceImage::create(Util::getResourcePath("lookup_gray.png"));
originImage_ = SourceImage::create(Util::getResourcePath("lookup_origin.png"));
skinImage_ = SourceImage::create(Util::getResourcePath("lookup_skin.png"));
customImage_ = SourceImage::create(Util::getResourcePath("lookup_light.png"));
return true;
}

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 73cbbe0

Please sign in to comment.