Skip to content

Commit

Permalink
writing stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreddie committed Sep 22, 2015
1 parent fed6d6e commit 59e3567
Show file tree
Hide file tree
Showing 7 changed files with 664 additions and 565 deletions.
49 changes: 49 additions & 0 deletions cfg/writing.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[net]
batch=64
subdivisions=1
height=256
width=256
channels=3
learning_rate=0.00001
momentum=0.9
decay=0.0005
seen=0

[crop]
crop_height=256
crop_width=256
flip=0
angle=0
saturation=1
exposure=1

[convolutional]
filters=32
size=3
stride=1
pad=1
activation=ramp

[convolutional]
filters=32
size=3
stride=1
pad=1
activation=ramp

[convolutional]
filters=32
size=3
stride=1
pad=1
activation=ramp

[convolutional]
filters=1
size=5
stride=1
pad=1
activation=logistic

[cost]

11 changes: 8 additions & 3 deletions src/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ matrix load_image_paths_gray(char **paths, int n, int w, int h)
X.cols = 0;

for(i = 0; i < n; ++i){
image im = load_image(paths[i], w, h, 1);
image im = load_image(paths[i], w, h, 3);

image gray = grayscale_image(im);
free_image(im);
im = gray;

X.vals[i] = im.data;
X.cols = im.h*im.w*im.c;
}
Expand Down Expand Up @@ -571,14 +576,14 @@ pthread_t load_data_in_thread(load_args args)
return thread;
}

data load_data_writing(char **paths, int n, int m, int w, int h)
data load_data_writing(char **paths, int n, int m, int w, int h, int downsample)
{
if(m) paths = get_random_paths(paths, n, m);
char **replace_paths = find_replace_paths(paths, n, ".png", "-label.png");
data d;
d.shallow = 0;
d.X = load_image_paths(paths, n, w, h);
d.y = load_image_paths_gray(replace_paths, n, w/8, h/8);
d.y = load_image_paths_gray(replace_paths, n, w/downsample, h/downsample);
if(m) free(paths);
int i;
for(i = 0; i < n; ++i) free(replace_paths[i]);
Expand Down
2 changes: 1 addition & 1 deletion src/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ box_label *read_boxes(char *filename, int *n);
data load_cifar10_data(char *filename);
data load_all_cifar10();

data load_data_writing(char **paths, int n, int m, int w, int h);
data load_data_writing(char **paths, int n, int m, int w, int h, int downsample);

list *get_paths(char *filename);
char **get_labels(char *filename);
Expand Down
Loading

0 comments on commit 59e3567

Please sign in to comment.