"tests/git@developer.sourcefind.cn:OpenDAS/mmcv.git" did not exist on "95417a5d24ab041b1055ab01ba0ad80b5ea28a48"
Commit dafec469 authored by Neal Wu's avatar Neal Wu
Browse files

Add back folder name improvements (no trailing slash)

parent 7df41199
...@@ -41,7 +41,7 @@ fi ...@@ -41,7 +41,7 @@ fi
# Create the output and temporary directories. # Create the output and temporary directories.
DATA_DIR="${1%/}" DATA_DIR="${1%/}"
SCRATCH_DIR="${DATA_DIR}/raw-data/" SCRATCH_DIR="${DATA_DIR}/raw-data"
mkdir -p "${DATA_DIR}" mkdir -p "${DATA_DIR}"
mkdir -p "${SCRATCH_DIR}" mkdir -p "${SCRATCH_DIR}"
WORK_DIR="$0.runfiles/inception/inception" WORK_DIR="$0.runfiles/inception/inception"
...@@ -59,8 +59,8 @@ else ...@@ -59,8 +59,8 @@ else
fi fi
# Note the locations of the train and validation data. # Note the locations of the train and validation data.
TRAIN_DIRECTORY="${SCRATCH_DIR}train/" TRAIN_DIRECTORY="${SCRATCH_DIR}/train"
VALIDATION_DIRECTORY="${SCRATCH_DIR}validation/" VALIDATION_DIRECTORY="${SCRATCH_DIR}/validation"
# Expands the data into the flower_photos/ directory and rename it as the # Expands the data into the flower_photos/ directory and rename it as the
# train directory. # train directory.
...@@ -74,14 +74,14 @@ ls -1 "${TRAIN_DIRECTORY}" | grep -v 'LICENSE' | sed 's/\///' | sort > "${LABELS ...@@ -74,14 +74,14 @@ ls -1 "${TRAIN_DIRECTORY}" | grep -v 'LICENSE' | sed 's/\///' | sort > "${LABELS
# Generate the validation data set. # Generate the validation data set.
while read LABEL; do while read LABEL; do
VALIDATION_DIR_FOR_LABEL="${VALIDATION_DIRECTORY}${LABEL}" VALIDATION_DIR_FOR_LABEL="${VALIDATION_DIRECTORY}/${LABEL}"
TRAIN_DIR_FOR_LABEL="${TRAIN_DIRECTORY}${LABEL}" TRAIN_DIR_FOR_LABEL="${TRAIN_DIRECTORY}/${LABEL}"
# Move the first randomly selected 100 images to the validation set. # Move the first randomly selected 100 images to the validation set.
mkdir -p "${VALIDATION_DIR_FOR_LABEL}" mkdir -p "${VALIDATION_DIR_FOR_LABEL}"
VALIDATION_IMAGES=$(ls -1 "${TRAIN_DIR_FOR_LABEL}" | shuf | head -100) VALIDATION_IMAGES=$(ls -1 "${TRAIN_DIR_FOR_LABEL}" | shuf | head -100)
for IMAGE in ${VALIDATION_IMAGES}; do for IMAGE in ${VALIDATION_IMAGES}; do
mv -f "${TRAIN_DIRECTORY}${LABEL}/${IMAGE}" "${VALIDATION_DIR_FOR_LABEL}" mv -f "${TRAIN_DIRECTORY}/${LABEL}/${IMAGE}" "${VALIDATION_DIR_FOR_LABEL}"
done done
done < "${LABELS_FILE}" done < "${LABELS_FILE}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment