VOC2012.sh 763 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 VOC2012 trainval ..."
  21. # Download the data.
  22. curl -LO http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
  23. echo "Done downloading."
  24. # Extract data
  25. echo "Extracting trainval ..."
  26. tar -xvf VOCtrainval_11-May-2012.tar
  27. echo "removing tar ..."
  28. rm VOCtrainval_11-May-2012.tar
  29. end=`date +%s`
  30. runtime=$((end-start))
  31. echo "Completed in" $runtime "seconds"