背景:我想要评估一个 SGG 模型在 VG_100K 数据集上运行的速度,但是这个数据集图片太多了,全部跑一遍 custom image inference 我感觉挺花时间,所以就想从中选 100 张图片出来,建立它们到我指定的一个目录的软链接,只给这些图片跑 SGG 模型。
直接上代码:
#!/bin/bash
# 对 /mnt/media/VG_100K 目录下的前 100 张图片建立到 /home/zyxu/checkpoints/custom_images 目录的软链接
cd /mnt/media/VG_100K
picName_top100=`ls |head -n 100`
for name in $picName_top100
do
ln -s /mnt/media/VG_100K/$name /home/zyxu/checkpoints/custom_images
echo $name
done