Ziming Yang

Results 10 comments of Ziming Yang
trafficstars

JSON文件的制作方法: **(一)提取视频帧的人脸图像。** 参考脚本[extract_images.py](https://github.com/ondyari/FaceForensics/tree/original/extract_images.py) 和 [detect_from_video.py](https://github.com/ondyari/FaceForensics/tree/master/classification/detect_from_video.py) 依次读取每个视频,使用人脸检测器Dlib检测视频帧的人脸区域,裁剪人脸区域并保存为图片,图片按照视频帧的顺序依次命名。每个视频的人脸图片保存在同一文件夹内,以便读取数据。 **(二)制作JSON文件。** 依次读取文件夹及其人脸图片路径,按文件名升序排序,根据数据库的ground truth获取真伪标签,写入JSON文件。JSON格式如下示例: { key: "ffpp001", value: {'list': ["ffpp001_001.jpg", "ffpp001_002.jpg", "ffpp001_003.jpg"], 'label': 0} }, { key: "ffpp002", value: {'list': ["ffpp002_001.jpg", "ffpp002_002.jpg", "ffpp002_003.jpg"], 'label': 1}...

Facial regions can be extracted by face detectors such as Dlib, MTCNN, etc. Partial regions are masked by the proposed Masked Relation Learner. The implementation is _class Model_ on Line...

> Has anyone successfully run this paper? I ran the pytorch version and it performed very well on the training set, but it performed very poorly on the validation set,...

> Hello, is it convenient to share the code of data preprocessing and the structure of data storage? Thank you very much Code of data preprocessing is [detect_from_video.py](https://github.com/ondyari/FaceForensics/blob/master/classification/detect_from_video.py). The structure...

How to get these data.json? **1. Extract facial images。** Refer to [extract_images.py](https://github.com/ondyari/FaceForensics/tree/original/extract_images.py) 和 [detect_from_video.py](https://github.com/ondyari/FaceForensics/tree/master/classification/detect_from_video.py). (1) Read videos of the dataset. (2) Extract the facial regions from video frames by face...

出现CUDA Out of Memory很可能因为没有启用混合精度训练模式,单显卡混合精度训练的指令: `python train_ffpp.py --amp --gpu 0` 经实验验证,batchsize=30,混合精度训练需要占用24GB显存,您的硬件符合要求,建议您使用混合精度训练模型。 训练参数以论文的Implementation Details(IV.A.2))为准,batchsize为30,每5个epoch学习率变为原来的1/2。代码实际没有使用warm up以及cosine策略,学习率调整策略使用了StepLR方法, `scheduler = optim.lr_scheduler.StepLR(opt, step_size=config.scheduler_step, gamma=config.scheduler_gamma)` 其他实验参数按照论文所述配置即可。

> > > > 您好,我在训练过程中也遇到了这种现象(训练时训练集上ACC高,验证集上只有50左右),请问您现在解决了吗,可能是什么原因引起的? > > > > > > > > > 我还没有解决,后来给作者发了邮件但是还没有回复,暂时这个部分搁置了 > > > > > > 您好,请问您提取视频帧的时候是提取了每个视频的所有视频帧吗? > > 是的,我提取了所有视频帧(针对部分视频检测有错误的情况,一些视频会选择最长正确区间) Batchsize过小容易影响模型的准确度,建议您按照上述方法使用混合精度amp训练模型。

您好,数据预处理的代码在[detect_from_video.py](https://github.com/ondyari/FaceForensics/blob/master/classification/detect_from_video.py). 预处理后数据存储的结构: data.json --video name 1 ----list (数据类型: List. 视频帧的文件名) ----label (数据类型: int. 真实:0. 伪造:1) --video name 2

> 好的,非常感谢您的帮助! > […](#) > ------------------ 原始邮件 ------------------ 发件人: "zimyang/MaskRelation" ***@***.***>; 发送时间: 2023年4月24日(星期一) 下午4:51 ***@***.***>; ***@***.******@***.***>; 主题: Re: [zimyang/MaskRelation] 数据预处理 (Issue #1) 您好,数据预处理的代码在detect_from_video.py. 预处理后数据存储的结构: data.json --video name 1 ----list (数据类型: List. 视频帧的文件名) ----label (数据类型:...

JSON文件的制作方法: **(一)提取视频帧的人脸图像。** 参考脚本[extract_images.py](https://github.com/ondyari/FaceForensics/tree/original/extract_images.py) 和 [detect_from_video.py](https://github.com/ondyari/FaceForensics/tree/master/classification/detect_from_video.py) 依次读取每个视频,使用人脸检测器Dlib检测视频帧的人脸区域,裁剪人脸区域并保存为图片,图片按照视频帧的顺序依次命名。每个视频的人脸图片保存在同一文件夹内,以便读取数据。 **(二)制作JSON文件。** 依次读取文件夹及其人脸图片路径,按文件名**升序排序**,根据数据库的ground truth获取真伪标签,写入JSON文件。JSON格式如下示例: { key: "ffpp001", value: {'list': ["ffpp001_001.jpg", "ffpp001_002.jpg", "ffpp001_003.jpg"], 'label': 0} }, { key: "ffpp002", value: {'list': ["ffpp002_001.jpg", "ffpp002_002.jpg", "ffpp002_003.jpg"], 'label': 1}...