Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init commit with face recgnition pipeline #2293

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions paddlex/configs/face_detection/BlazeFace-FPN-SSH.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Global:
model: BlazeFace-FPN-SSH
mode: check_dataset # check_dataset/train/evaluate/predict
dataset_dir: "/paddle/dataset/paddlex/det/widerface_coco_examples"
device: gpu:0,1,2,3
output: "output"

CheckDataset:
convert:
enable: False
src_dataset_type: null
split:
enable: False
train_percent: null
val_percent: null

Train:
num_classes: 1
epochs_iters: 50
batch_size: 4
learning_rate: 0.001
pretrain_weight_path: null
warmup_steps: 500
resume_path: null
log_interval: 10
eval_interval: 1

Evaluate:
weight_path: "output/best_model/best_model.pdparams"
log_interval: 10

Export:
weight_path: https://paddledet.bj.bcebos.com/models/blazeface_fpn_ssh_1000e.pdparams

Predict:
batch_size: 1
model_dir: "output/blazeface_fpn_ssh"
input: "https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/face_detection.png"
kernel_option:
run_mode: paddle
40 changes: 40 additions & 0 deletions paddlex/configs/face_detection/BlazeFace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Global:
model: BlazeFace
mode: check_dataset # check_dataset/train/evaluate/predict
dataset_dir: "/paddle/dataset/paddlex/det/widerface_coco_examples"
device: gpu:0,1,2,3
output: "output"

CheckDataset:
convert:
enable: False
src_dataset_type: null
split:
enable: False
train_percent: null
val_percent: null

Train:
num_classes: 1
epochs_iters: 50
batch_size: 4
learning_rate: 0.001
pretrain_weight_path: null
warmup_steps: 500
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一共1000iter,warmup 500?

resume_path: null
log_interval: 10
eval_interval: 1

Evaluate:
weight_path: "output/best_model/best_model.pdparams"
log_interval: 10

Export:
weight_path: https://paddledet.bj.bcebos.com/models/blazeface_1000e.pdparams

Predict:
batch_size: 1
model_dir: "output/blazeface"
input: "https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/face_detection.png"
kernel_option:
run_mode: paddle
40 changes: 40 additions & 0 deletions paddlex/configs/face_detection/PP-YOLOE_plus-S_face.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Global:
model: PP-YOLOE_plus-S_face
mode: check_dataset # check_dataset/train/evaluate/predict
dataset_dir: "/paddle/dataset/paddlex/det/widerface_coco_examples"
device: gpu:0,1,2,3
output: "output"

CheckDataset:
convert:
enable: False
src_dataset_type: null
split:
enable: False
train_percent: null
val_percent: null

Train:
num_classes: 1
epochs_iters: 50
batch_size: 4
learning_rate: 0.0001
pretrain_weight_path: null
warmup_steps: 100
resume_path: null
log_interval: 10
eval_interval: 1

Evaluate:
weight_path: "output/best_model/best_model.pdparams"
log_interval: 10

Export:
weight_path: https://paddledet.bj.bcebos.com/models/ppyoloe_plus-s_face.pdparams

Predict:
batch_size: 1
model_dir: "output/best_model/inference"
input: "https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/face_detection.png"
kernel_option:
run_mode: paddle
41 changes: 41 additions & 0 deletions paddlex/configs/face_recognition/MobileFaceNet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Global:
model: MobileFaceNet
mode: check_dataset # check_dataset/train/evaluate/predict
dataset_dir: "/paddle/dataset/paddlex/cls/face_train_examples"
device: gpu:0,1,2,3
output: "output"

CheckDataset:
convert:
enable: False
src_dataset_type: null
split:
enable: False
train_percent: null
val_percent: null

Train:
num_classes: 995
epochs_iters: 25
batch_size: 128
learning_rate: 0.002
pretrain_weight_path: null
warmup_steps: 1
resume_path: null
log_interval: 1
eval_interval: 1
save_interval: 1

Evaluate:
weight_path: "output/best_model/best_model.pdparams"
log_interval: 1

Export:
weight_path: https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/foundation_models/mobilefacenet.pdparams

Predict:
batch_size: 1
model_dir: "output/best_model/inference"
input: "https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/face_classification_001.jpg"
kernel_option:
run_mode: paddle
41 changes: 41 additions & 0 deletions paddlex/configs/face_recognition/ResNet50_face.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Global:
model: ResNet50_face
mode: check_dataset # check_dataset/train/evaluate/predict
dataset_dir: "/paddle/dataset/paddlex/cls/face_train_examples"
device: gpu:0,1,2,3
output: "output"

CheckDataset:
convert:
enable: False
src_dataset_type: null
split:
enable: False
train_percent: null
val_percent: null

Train:
num_classes: 995
epochs_iters: 25
batch_size: 64
learning_rate: 0.004
pretrain_weight_path: null
warmup_steps: 1
resume_path: null
log_interval: 1
eval_interval: 1
save_interval: 1

Evaluate:
weight_path: "output/best_model/best_model.pdparams"
log_interval: 1

Export:
weight_path: https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/foundation_models/mobilefacenet.pdparams

Predict:
batch_size: 1
model_dir: "output/best_model/inference"
input: "https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/face_classification_001.jpg"
kernel_option:
run_mode: paddle
1 change: 1 addition & 0 deletions paddlex/inference/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
from .transforms import *
from .paddle_predictor import *
from .task_related import *
from .retrieval import *
15 changes: 15 additions & 0 deletions paddlex/inference/components/retrieval/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# copyright (c) 2024 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from .faiss import FaissIndexer
Loading