• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    C++
  • Created over 1 year ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

an example of segment-anything infer by ncnn

segment-anything-ncnn

a ncnn example of segment-anything

PS:

  1. the image_embeddings maybe take a long time, because of some MultiHeadAttention ops isn't fused.
  2. maybe we should use pnnx to optimize this.

model support:

  1. ViT-B SAM model

models are available in Baidu Pan and Google Drive

Run

mkdir -p build
cd build
cmake ..
make
./ncnn_sam

time profile

op type         avg time(ms)    %
MatMul          2268.23         21.14%
Reshape         2199.36         20.51%
InnerProduct    1899.4          17.71%
GELU            1809.85         16.87%
BinaryOp        1351.21         12.61%
Softmax         513.15          4.78%
Permute         442.24          4.12%
Crop            106.28          0.99%
LayerNorm       65.11           0.61%
Padding         35.7            0.33%
Convolution     34.43           0.32%
MemoryData      2.76            0.03%
Split           0.00            0%
total time:     10727.72

Result

automatic_mask:

prompt points

prompt box

Reference

1.https://github.com/facebookresearch/segment-anything
2.https://github.com/Tencent/ncnn

More Repositories

1

ncnn-android-yolov8

Real time yolov8 Android demo by ncnn
C++
360
star
2

ncnn-android-yolox

Real time yolox Android demo by ncnn
C++
301
star
3

ncnn_paddleocr

Android paddleocr demo infer by ncnn
C++
160
star
4

ncnn_Android_face

Android face detect and segmentation,facemesh by ncnn
C++
160
star
5

ncnn_Android_RobustVideoMatting

Android human segmentation by ncnn
C++
151
star
6

ncnn_Android_MoveNet

Android MoveNet pose estimation by ncnn
C++
122
star
7

CodeFormer-ncnn

ncnn version of CodeFormer
C++
96
star
8

ncnn_nanodet_hand

Android hand detect and pose estimation by ncnn
C++
92
star
9

ncnn_Android_blazeface

This a demo of BlazeFace infer by ncnn
C++
84
star
10

ncnn_Android_BlazePose

Android BlazePose demo by ncnn
C++
81
star
11

yolov5-seg-ncnn

c++ version of yolov5 segmentation with ncnn
C++
77
star
12

GFPGAN-ncnn

a naive NCNN implementation of GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration
C++
74
star
13

ncnn-Android-mediapipe_hand

a mediapipe-hand demo infer by ncnn
C++
64
star
14

ncnn-android-yolov6

C++
62
star
15

ncnn_Android_matting

Android and Windows human matting demo infer by ncnn
Java
56
star
16

yolov7-mask-ncnn

c++ version of yolov7-mask with ncnn
C++
56
star
17

YOLOPv2-ncnn

C++
55
star
18

ncnn-android-depth_anything

a Android demo of depth_anything_v1 and depth_anything_v2
C++
48
star
19

DocTr-ncnn

ncnn demo of (文档矫正)DocTr: Document Image Transformer for Geometric Unwarping and Illumination Correction
C++
42
star
20

trt2023

NVIDIA TensorRT Hackathon 2023复赛选题:通义千问Qwen-7B用TensorRT-LLM模型搭建及优化
C++
39
star
21

ncnn_Android_LightTrack

Android demo of LightTrack infer by ncnn
C++
36
star
22

ncnn_Android_hair

Android hair segmentation demo by ncnn
C++
27
star
23

ncnn_Android_PP-TinyPose

ncnn Android demo of PP-TinyPose
C++
25
star
24

ncnn_Android_LivePortrait

a naive example of LivePortrait infer by ncnn
C++
24
star
25

animegan2-ncnn-vulkan

a demo of Animeganv2 infer by ncnn
C++
22
star
26

ncnn_Android_mlsd

M-LSD Android demo infer by ncnn
C++
22
star
27

ncnn_ppstructure

ppstructure deploy by ncnn
21
star
28

Mask2Former-ncnn

naive c++ version of Mask2Former with ncnn
C++
19
star
29

ncnn_MakeupTransfer

SSAT Makeup/Makeup Transfer infer by ncnn
C++
18
star
30

ncnn-yolox-hand

Android yolox hand detect by ncnn
C++
17
star
31

ncnn_Android_CrowdCounting

Android CrowdCounting demo infer by ncnn
C++
10
star
32

segformer-tengine

segformer semantic segmentation infer by tengine
C
9
star
33

tengine_Android_hand_npu

Android hand Demo infer by tengine on vim3
1
star