Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
models
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitsoko services
models
Commits
dafec469
Commit
dafec469
authored
Apr 10, 2017
by
Neal Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add back folder name improvements (no trailing slash)
parent
7df41199
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
download_and_preprocess_flowers.sh
inception/inception/data/download_and_preprocess_flowers.sh
+6
-6
No files found.
inception/inception/data/download_and_preprocess_flowers.sh
View file @
dafec469
...
...
@@ -41,7 +41,7 @@ fi
# Create the output and temporary directories.
DATA_DIR
=
"
${
1
%/
}
"
SCRATCH_DIR
=
"
${
DATA_DIR
}
/raw-data
/
"
SCRATCH_DIR
=
"
${
DATA_DIR
}
/raw-data"
mkdir
-p
"
${
DATA_DIR
}
"
mkdir
-p
"
${
SCRATCH_DIR
}
"
WORK_DIR
=
"
$0
.runfiles/inception/inception"
...
...
@@ -59,8 +59,8 @@ else
fi
# Note the locations of the train and validation data.
TRAIN_DIRECTORY
=
"
${
SCRATCH_DIR
}
train/
"
VALIDATION_DIRECTORY
=
"
${
SCRATCH_DIR
}
validation/
"
TRAIN_DIRECTORY
=
"
${
SCRATCH_DIR
}
/train
"
VALIDATION_DIRECTORY
=
"
${
SCRATCH_DIR
}
/validation
"
# Expands the data into the flower_photos/ directory and rename it as the
# train directory.
...
...
@@ -74,14 +74,14 @@ ls -1 "${TRAIN_DIRECTORY}" | grep -v 'LICENSE' | sed 's/\///' | sort > "${LABELS
# Generate the validation data set.
while
read
LABEL
;
do
VALIDATION_DIR_FOR_LABEL
=
"
${
VALIDATION_DIRECTORY
}${
LABEL
}
"
TRAIN_DIR_FOR_LABEL
=
"
${
TRAIN_DIRECTORY
}${
LABEL
}
"
VALIDATION_DIR_FOR_LABEL
=
"
${
VALIDATION_DIRECTORY
}
/
${
LABEL
}
"
TRAIN_DIR_FOR_LABEL
=
"
${
TRAIN_DIRECTORY
}
/
${
LABEL
}
"
# Move the first randomly selected 100 images to the validation set.
mkdir
-p
"
${
VALIDATION_DIR_FOR_LABEL
}
"
VALIDATION_IMAGES
=
$(
ls
-1
"
${
TRAIN_DIR_FOR_LABEL
}
"
|
shuf
|
head
-100
)
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
<
"
${
LABELS_FILE
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment