Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
BUPTLdy committed Nov 1, 2017
1 parent 8d16dae commit fc6c082
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 10 deletions.
6 changes: 3 additions & 3 deletions extract_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def main(_):

print 'extract traning feature'

data_files = glob(os.path.join("./data", 'uc_train_256_feat', "*.jpg"))
data_files = glob(os.path.join("./data", 'uc_train_256_data', "*.jpg"))
shuffle(data_files)


Expand Down Expand Up @@ -129,7 +129,7 @@ def main(_):
begin = FLAGS.batch_size*idx
end = FLAGS.batch_size + begin
feats[begin:end, ...] = feat

print idx
np.save('features/features%d_train.npy'%num, feats)
np.save('features/label%d_train.npy'%num, y)

Expand Down Expand Up @@ -167,7 +167,7 @@ def main(_):
end = FLAGS.batch_size + begin
feats[begin:end, ...] = feat

#print idx
print idx

np.save('features/features%d_test.npy'%num, feats)
np.save('features/label%d_test.npy'%num, y)
Expand Down
2 changes: 2 additions & 0 deletions features/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 1 addition & 1 deletion network.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

def generator_simplified_api(inputs, is_train=True, reuse=False):
image_size = 256
k = 5
k = 4
# 128, 64, 32, 16
s2, s4, s8, s16, s32, s64 = int(image_size/2), int(image_size/4), int(image_size/8), int(image_size/16), int(image_size/32), int(image_size/64)

Expand Down
21 changes: 21 additions & 0 deletions style_names.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mobilehomepark
beach
tenniscourt
airplane
denseresidential
harbor
buildings
forest
intersection
river
sparseresidential
runway
parkinglot
baseballdiamond
agricultural
storagetanks
chaparral
golfcourse
freeway
mediumresidential
overpass
2 changes: 1 addition & 1 deletion train_marta_gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def main(_):
print("[Sample] d_loss: %.8f, g_loss: %.8f" % (errD, errG))
# for i in range(len(D)):
# print D[i].shape
print D[-1], D_, sigmoid(D[-1]), sigmoid(D[-1])==D_
#print D[-1], D_, sigmoid(D[-1]), sigmoid(D[-1])==D_
sys.stdout.flush()

if np.mod(epoch, 5) == 0:
Expand Down
10 changes: 5 additions & 5 deletions train_svm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
#
import numpy as np
acc = []
nums = [55, 60, 65, 70, 75, 80, 85]
nums = [75]
for num in nums:
X_train=np.load('feat_match/features%d_train.npy'%num)
y_train=np.load('feat_match/label%d_train.npy'%num)
X_test=np.load('feat_match/features%d_test.npy'%num)
y_test=np.load('feat_match/label%d_test.npy'%num)
X_train=np.load('features/features%d_train.npy'%num)
y_train=np.load('features/label%d_train.npy'%num)
X_test=np.load('features/features%d_test.npy'%num)
y_test=np.load('features/label%d_test.npy'%num)

print("Fitting the classifier to the training set")
t0 = time()
Expand Down

0 comments on commit fc6c082

Please sign in to comment.