Skip to content

Instantly share code, notes, and snippets.

@fgerard
Created May 13, 2021 16:13
Show Gist options
  • Save fgerard/baf0c1c65fe05dfa89582fbd76dc73c8 to your computer and use it in GitHub Desktop.
Save fgerard/baf0c1c65fe05dfa89582fbd76dc73c8 to your computer and use it in GitHub Desktop.
Este sirve para una vez que limpias con rectlabel un dataset autogenerado le quitas lo repetitivo
#!/bin/bash
mv $1 $1-all
mkdir $1
mkdir $1/annotations
for f in $( cat $1-all/extras.txt )
do
cp -v $1-all/$f $1/
done
for f in $( ls $1-all/annotations | egrep "xml$" )
do
if test $( egrep "object" $1-all/annotations/$f | wc -l ) -gt 0
then
cp -v $1-all/annotations/$f $1/annotations/
else
echo "skiping: $f"
fi
done
for f in $( ls $1/annotations | egrep "xml$" )
do
a=${f:0:$(( ${#f} - 4 )) }
cp -v $1-all/$a.jpg $1/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment