-
Notifications
You must be signed in to change notification settings - Fork 952
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
base: develop
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
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/blazeface" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
统一为output吧 文档默认路径都是output
Global: | ||
model: IResNet50 | ||
mode: check_dataset # check_dataset/train/evaluate/predict | ||
dataset_dir: "/paddle/dataset/paddlex/cls/cls_flowers_examples" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
人脸识别数据格式和这个不一样吧,建一个人脸识别demo数据集
log_interval: 1 | ||
|
||
Export: | ||
weight_path: https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/foundation_models/CLIP_vit_base_patch16_224_ft_in1k_pretrained.pdparams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
预训练模型是CLIP不对吧,这个换成你训练好的这个算法的人脸识别模型
val_percent: null | ||
|
||
Train: | ||
num_classes: 93431 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类别数量需要和你上面建立的数据集的类别数量一致
@@ -0,0 +1,41 @@ | |||
Global: | |||
model: IResNet50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
算法名称需要和配置文件的文件名一致。文件名就叫做 IResNet50.yaml即可
batch_size: 128 | ||
drop_last: False | ||
shuffle: True | ||
#sample_method: "id_avg_prob" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释不要的删除
num_workers: 4 | ||
use_shared_memory: True | ||
|
||
# Infer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
infer是需要配置的 不然导出有问题
@@ -258,6 +258,7 @@ | |||
"RT-DETR-H_layout_3cls": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/RT-DETR-H_layout_3cls_infer.tar", | |||
"RT-DETR-H_layout_17cls": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/RT-DETR-H_layout_17cls_infer.tar", | |||
"PicoDet_LCNet_x2_5_face": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/PicoDet_LCNet_x2_5_face_infer.tar", | |||
"BlazeFace": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/BlazeFace_infer.tar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
识别的模型也需要填写上
# limitations under the License. | ||
|
||
import numpy as np | ||
from paddlex.inference.components import CropByBoxes, FaissIndexer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
都改成相对的吧
import numpy as np | ||
|
||
from paddlex.utils.func_register import FuncRegister | ||
from paddlex.modules.face_recognition.model_list import MODELS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
相对路径比如 from ...utils.func_register import FuncRegister
dtype = ( | ||
np.uint8 if self._metric_type in self.BINARY_METRIC_TYPE else np.float32 | ||
) | ||
features = np.array(features).astype(dtype) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否需要取平均呢?
pickle.dump(ids, fd) | ||
|
||
|
||
def get_file_list(data_file, root_dir, delimiter="\t"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建库的文件组织方式和这个是不同的吧
f7a1c02
to
acaaa64
Compare
super().__init__(device, predictor_kwargs) | ||
self._build_predictor(det_model, rec_model) | ||
self.set_predictor(det_batch_size, rec_batch_size, device) | ||
self._indexer = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里加个is_build的参数吧,如果is_build=True 就调用self.build_index()建库,库保存在index_dir,如果是false相当于用户有自己的库,就传入index_dir就可以。
det_batch_size=1, | ||
rec_batch_size=1, | ||
index_dir=None, | ||
metric_type="IP", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认是L2还是IP?
batch_size: 4 | ||
learning_rate: 0.001 | ||
pretrain_weight_path: null | ||
warmup_steps: 500 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一共1000iter,warmup 500?
@@ -0,0 +1,41 @@ | |||
Global: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个模型要下掉吧?
CheckDataset: | ||
convert: | ||
enable: False | ||
src_dataset_ype: null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type?
|
||
MODELS = [ | ||
"MobileFaceNet", | ||
"IResnet50" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里名字又没对上
self.train_config.pretrain_weight_path | ||
) | ||
|
||
label_dict_path = Path(self.global_config.dataset_dir).joinpath("label.txt") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你的数据集还是否需要label.txt
name: Momentum | ||
momentum: 0.9 | ||
lr: | ||
name: Piecewise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议直接cosine梭哈
Train: | ||
dataset: | ||
name: ImageNetDataset | ||
image_root: dataset/MS1M_v3/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的root不对吧
epochs: 25 | ||
print_batch_step: 20 | ||
use_visualdl: False | ||
eval_mode: face_recognition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下边这些参数不应该在global中,应该放到Eval中
Global: | ||
model: IResNet50 | ||
mode: check_dataset # check_dataset/train/evaluate/predict | ||
dataset_dir: "/paddle/dataset/paddlex/cls/face_train_examples" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
face_rec_examples
No description provided.