本文主要是介绍Detection of ADHD based on Eye Movements during Natural Viewing论文代码复现,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Detection of ADHD based on Eye Movements during Natural Viewing论文的复现
论文链接:https://arxiv.org/pdf/2207.01377.pdf
代码链接:https://github.com/aeye-lab/ecml-ADHD
1.环境搭建
- 原始环境搭建存在不兼容,修改后requiremen.txt
降低安装包的版本就可以
joblib==1.0.1
Keras==2.4.3
matplotlib==3.4.0
numpy==1.24.4
opencv_python==4.5.1.48
pandas==1.2.3
scikit_learn==1.1.1
scipy==1.10.1
seaborn==0.11.1
tensorflow==2.4.0
tqdm==4.59.0
2. 数据准备
2.1. 训练视频下载
- youtube视频下载:用chrome插件下载
2.2. ffmpeg做成图片(自己写了个代码):
- 下面是我写的:
sudo apt install ffmpeg
import os
import subprocess# 定义你的根目录
root_dir = '/home/ywj/work/code/ecml-ADHD/Data/videos'# 遍历根目录
for subdir, dirs, files in os.walk(root_dir):for file in files:# 检查文件是否为MP4视频if file.endswith(".mp4"):video_path = os.path.join(subdir, file)# 构造输出格式,帧图像将保存在与视频相同的目录中output_path = os.path.join(subdir, "frame{}.jpg")# 构造ffmpeg命令command = ['ffmpeg', '-i', video_path, '-vf', 'fps=1', output_path.format('%d')]# 执行命令subprocess.run(command)print(f'完成处理视频: {video_path}')print("所有视频处理完成。")
- 处理结果
- 再将图片的序号改为从0开始就行
2.3. 生成所有视频的saliency 图
bash gen_saliency_map_data.sh
2.4. 生成模型输入数据
bash gen_model_input_data.sh
3. 模型训练
bash run_models.sh
4.BUG解决
cudann Could not load dynamic library ‘libcudnn.so.8’
https://blog.csdn.net/weixin_46584887/article/details/122729896
- 我是cuda11.1 ubuntu18.04:
https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64/
Could not load dynamic library ‘libcusolver.so.10’
https://zhuanlan.zhihu.com/p/340204428
这篇关于Detection of ADHD based on Eye Movements during Natural Viewing论文代码复现的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!