代码如下:
search_dir=" "
faceSearch(){
success=0
false=0
for folder in `ls ${search_dir}`
do
name=${folder}
for img in `ls ${search_dir}/${name}`
do
result=$(curl 119.168.1.66:2000/face -X POST -F "file=@${search_dir}/${name}/${img}" -F "groupId=001")
isSuccess=$(echo $result | python3 -c "import json; import sys; obj=json.load(sys.stdin);\
print(obj['success'])")
if [ $isSuccess = 'True' ]
then
((success++))
else
((false++))
fi
done
done
echo ${success}
echo ${false}
}
faceSearch