Skip to content

Vincent-ZHQ/Debug_Record

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Debug_Record

A record for code debugging.

1. Extract audio (.wav) from video (.mp4) with ffmpeg.

ffmpeg -y -i " + file_path + " -ac 1 -ar 16000 "  + new_path
-y overwrite
-ac 1 get one channel
-ar 16000 set the sample_rate as 16kHz

refer:1, 2

2. read audio with three different tools

refer: 1, 2, 3

3. Change 2-d list to 1-d

list1 = [[1, 1], [2, 2]]
ans = [item for list in list1 for item in list]

refer: 1

4. Pytorch-Lightening

使用模板参考1, 参考2

torchmetrics文档

torchmetrics in Pytorch-Lightening

Pandas 数据读取

参考: 1

WeightedRandomSampler 处理不平衡集

Sampler, WeightedRandomSampler理解, 方法

Linux commands

# 删除目录下文件夹
find . -type d | sed -n '2,$p' | xargs rm -rf

# 统计当前目录下文件的个数
ls -l | grep "^-" | wc -l

# 统计当前目录下文件的个数(包括子目录)
ls -lR| grep "^-" | wc -l

# 查看某目录下文件夹(目录)的个数(包括子目录)
ls -lR | grep "^d" | wc -l

# 查看存储空间使用情况
du -h -d 1

参考:linux批量删除目录下的文件夹而不删除文件 统计文件夹下的文件数目

ffmpeg install problems

conda install x264=='1!152.20180717' ffmpeg=4.0.2 -c conda-forge

conda install -c conda-forge x264=='1!161.3030' ffmpeg=4.3.2

conda commands

# 创建新环境
conda create -n name python==version

# 清理不必要的库包表文件
conda clean -a


https://codeantenna.com/a/P7NmFC4N8N

CAM and heatmap

Pytorch可视化神经网络热力图(CAM) 请问注意力机制中生成的类似热力图或者柱状图是如何生成的? Python画attention map与原图叠加的热力图 深度学习之如何使用Grad-CAM绘制自己的特征提取图 Visualization Method Corresponding to Regression Problems and Its Application to Deep Learning-Based Gaze Estimation Model

About

A record for code debugging.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published