VOC2007.sh 971 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # Ellis Brown
  3. start=`date +%s`
  4. # handle optional download dir
  5. if [ -z "$1" ]
  6. then
  7. # navigate to ~/data
  8. echo "navigating to ~/data/ ..."
  9. mkdir -p ~/data
  10. cd ~/data/
  11. else
  12. # check if is valid directory
  13. if [ ! -d $1 ]; then
  14. echo $1 "is not a valid directory"
  15. exit 0
  16. fi
  17. echo "navigating to" $1 "..."
  18. cd $1
  19. fi
  20. echo "Downloading VOC2007 trainval ..."
  21. # Download the data.
  22. curl -LO http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
  23. echo "Downloading VOC2007 test data ..."
  24. curl -LO http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
  25. echo "Done downloading."
  26. # Extract data
  27. echo "Extracting trainval ..."
  28. tar -xvf VOCtrainval_06-Nov-2007.tar
  29. echo "Extracting test ..."
  30. tar -xvf VOCtest_06-Nov-2007.tar
  31. echo "removing tars ..."
  32. rm VOCtrainval_06-Nov-2007.tar
  33. rm VOCtest_06-Nov-2007.tar
  34. end=`date +%s`
  35. runtime=$((end-start))
  36. echo "Completed in" $runtime "seconds"