testModelByScene.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #! bin/bash
  2. if [ -z "$1" ]
  3. then
  4. echo "No first argument supplied"
  5. echo "Need of vector size"
  6. exit 1
  7. fi
  8. if [ -z "$2" ]
  9. then
  10. echo "No second argument supplied"
  11. echo "Need of model input"
  12. exit 1
  13. fi
  14. if [ -z "$3" ]
  15. then
  16. echo "No third argument supplied"
  17. echo "Need of separator char : ':', ';'"
  18. exit 1
  19. fi
  20. if [ -z "$4" ]
  21. then
  22. echo "No fourth argument supplied"
  23. echo "Need of index row indication : 0 or 1"
  24. exit 1
  25. fi
  26. VECTOR_SIZE=$1
  27. INPUT_MODEL=$2
  28. INPUT_SEP=$3
  29. INPUT_ROW=$4
  30. for size in {"4","8","16","26","32","40"}; do
  31. start=0
  32. for counter in {0..4}; do
  33. end=$(($start+$size))
  34. if [ "$end" -gt "$VECTOR_SIZE" ]; then
  35. start=$(($VECTOR_SIZE-$size))
  36. end=$(($VECTOR_SIZE))
  37. fi
  38. zones = "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15"
  39. zones_str="${zones//, /-}"
  40. for scene in {"A","B","C","D","E","F","G","H","I"}; do
  41. for mode in {"svd","svdn","svdne"}; do
  42. FILENAME="data_svm/data_${mode}_N${size}_B${start}_E${end}_scene${scene}"
  43. echo $FILENAME
  44. python generate_data_svm.py --output ${FILENAME} --interval "${start},${end}" --kind ${mode} --scenes "${scene}" --zones "${zones}" --percent 1 --sep "${INPUT_SEP}" --rowindex "${INPUT_ROW}"
  45. python prediction.py --data "$FILENAME.train" --model ${INPUT_MODEL} --output "${INPUT_MODEL}.prediction"
  46. done
  47. done
  48. start=$(($start+50))
  49. done
  50. done