This repository has been archived by the owner on Aug 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
19,621 additions
and
5,785 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/Celeb-A_Cropped/000001.jpg 1 | ||
/Celeb-A_Cropped/000002.jpg 1 | ||
/Celeb-A_Cropped/000003.jpg 1 | ||
/Celeb-A_Cropped/000004.jpg 1 | ||
/Celeb-A_Cropped/000005.jpg 1 | ||
/Celeb-A_Cropped/000006.jpg 1 | ||
/Celeb-A_Cropped/000007.jpg 1 | ||
/Celeb-A_Cropped/000008.jpg 1 | ||
/Celeb-A_Cropped/000009.jpg 1 | ||
/Celeb-A_Cropped/000010.jpg 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from PIL import Image | ||
import os | ||
import sys | ||
|
||
print "" | ||
print "Prepare Celeb-A Dataset! (1. Crop the images. 2. Generate a train list file.)" | ||
print "" | ||
print "-------------------------------------------------------------------------------" | ||
|
||
current_path = os.getcwd() | ||
celebA_path = "" | ||
celebA_cropped_path = "" | ||
print "The current path containing this python file is: " + current_path | ||
if len(sys.argv) == 1: | ||
print "Please give the path of original Celeb-A dataset!" | ||
exit(0) | ||
elif len(sys.argv) > 1: | ||
print "The path of original Celeb-A dataset is: " + str(sys.argv[1]) | ||
celebA_path = sys.argv[1] | ||
celebA_cropped_path = os.path.dirname(celebA_path) + os.sep + "Cropped" #To avoid crop the generated images again if this parameter is not provided | ||
if len(sys.argv) > 2: | ||
print "The path of cropped Celeb-A dataset will be: " + str(sys.argv[2]) | ||
celebA_cropped_path = sys.argv[2] | ||
else: | ||
print "The path of cropped Celeb-A dataset will be defult, set as: " + celebA_cropped_path | ||
|
||
if os.path.exists(celebA_cropped_path): | ||
print "The path of cropped Celeb-A dataset exists." | ||
else: | ||
print "The path of cropped Celeb-A dataset doesn't exist! I will create it now!" | ||
os.makedirs(celebA_cropped_path) | ||
print "-------------------------------------------------------------------------------" | ||
|
||
training_list_file = os.path.join(celebA_cropped_path, "celebA.txt") | ||
list_file = open(training_list_file, 'w') | ||
total_image_num = 0 | ||
x1, y1 = 30, 40 | ||
cropped_box = (x1, y1, x1 + 138, y1 + 138) | ||
|
||
for parent,dirnames,filenames in os.walk(celebA_path): | ||
for filename in filenames: | ||
if filename.endswith(".jpg"): | ||
total_image_num += 1 | ||
#print "parent is:" + parent | ||
#print "filename is:" + filename | ||
image_path_and_name = os.path.join(parent,filename) | ||
print "the full name of the file is: " + image_path_and_name | ||
input_image = Image.open(image_path_and_name) | ||
#input_image.show() | ||
cropped_image = input_image.crop(cropped_box) | ||
#cropped_image.show() | ||
scaled_cropped_image = cropped_image.resize((64, 64)) | ||
#scaled_cropped_image.show() | ||
save_result_image_path_and_name = os.path.join(celebA_cropped_path,filename) | ||
scaled_cropped_image.save(save_result_image_path_and_name, 'jpeg') | ||
list_file.writelines(save_result_image_path_and_name) | ||
list_file.writelines(" 1" + "\n") #Must add label to list file | ||
print "There are " + str(total_image_num) + " images are finished with cropping and scaling operations!" | ||
list_file.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,9 @@ MAINTAINER [email protected] | |
#ENV http_proxy proxy:port | ||
#ENV https_proxy proxy:port | ||
|
||
RUN rpm -iUvh http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm | ||
RUN rpm -iUvh http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm | ||
|
||
RUN yum upgrade -y | ||
|
||
RUN yum install -y \ | ||
redhat-rpm-config \ | ||
|
@@ -15,6 +17,7 @@ RUN yum install -y \ | |
cmake \ | ||
git \ | ||
wget \ | ||
ssh \ | ||
atlas-devel \ | ||
boost-devel \ | ||
gflags-devel \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ubuntu:14.04 | ||
FROM ubuntu:16.04 | ||
MAINTAINER [email protected] | ||
|
||
#ENV http_proxy proxy:port | ||
|
@@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ | |
cmake \ | ||
git \ | ||
wget \ | ||
ssh \ | ||
libboost-all-dev \ | ||
libgflags-dev \ | ||
libgoogle-glog-dev \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
472bbbf05ce5ff5c072811220c55cf9b5bbd96ad | ||
ba482eca9459e3b9a8256ab07f9afa41dba34b9e |
25 changes: 25 additions & 0 deletions
25
models/intel_optimized_models/alexnet/knm/solver_dummydata.prototxt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#This is Intel(R) optimized (in terms of time to train) version of solver for model described in the [AlexNet](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks) publication. | ||
#Original solver.prototxt can be found in /models/bvlc_alexnet/ directory of this repository. | ||
#Differences: | ||
#- lr_policy is set to poly instead of step | ||
#- base_lr is decreased to 0.007 | ||
#- max_iter is decreased to 250000 | ||
#- power is set to 0.6 | ||
# | ||
#Top-5 and Top-1 results achieved with this version of solver: | ||
#Top-5: 80.4% | ||
#Top-1: 57.4% | ||
#Training was performed using server equipped with Intel(R) Xeon Phi(TM) CPU 7250 processor. | ||
net: "models/intel_optimized_models/alexnet/knm/train_val_dummydata.prototxt" | ||
test_iter: 1000 | ||
test_interval: 10000 | ||
base_lr: 0.007 | ||
lr_policy: "poly" | ||
power: 0.6 | ||
display: 1 | ||
max_iter: 5000 | ||
momentum: 0.9 | ||
weight_decay: 0.0005 | ||
snapshot: 50000 | ||
snapshot_prefix: "models/intel_optimized_models/alexnet/knm/alexnet_train" | ||
solver_mode: CPU |
Oops, something went wrong.