Skip to content

Commit

Permalink
init commit with face recgnition pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-q8 committed Oct 22, 2024
1 parent 70a0a58 commit f7a1c02
Show file tree
Hide file tree
Showing 34 changed files with 1,739 additions and 5 deletions.
39 changes: 39 additions & 0 deletions paddlex/configs/face_detection/BlazeFace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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:
epochs_iters: 1000
batch_size: 4
learning_rate: 0.001
pretrain_weight_path: null
warmup_steps: 500
resume_path: null
log_interval: 10
eval_interval: 10

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
41 changes: 41 additions & 0 deletions paddlex/configs/face_recognition/IResNet50.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Global:
model: IResNet50
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/iresnet50.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/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_ype: 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
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

0 comments on commit f7a1c02

Please sign in to comment.