going to split things up

This commit is contained in:
Joseph Redmon 2015-03-06 09:49:05 -08:00
parent fb9e0fe336
commit 26cddc6f93
2 changed files with 6 additions and 4 deletions

View File

@ -302,7 +302,7 @@ void validate_captcha(char *cfgfile, char *weightfile)
} }
int imgs = 1000; int imgs = 1000;
int numchars = 37; int numchars = 37;
list *plist = get_paths("/data/captcha/valid.list"); list *plist = get_paths("/data/captcha/valid.base");
char **paths = (char **)list_to_array(plist); char **paths = (char **)list_to_array(plist);
data valid = load_data_captcha(paths, imgs, 0, 10, 60, 200); data valid = load_data_captcha(paths, imgs, 0, 10, 60, 200);
translate_data_rows(valid, -128); translate_data_rows(valid, -128);
@ -329,9 +329,10 @@ void validate_captcha(char *cfgfile, char *weightfile)
void test_captcha(char *cfgfile, char *weightfile) void test_captcha(char *cfgfile, char *weightfile)
{ {
setbuf(stdout, NULL);
srand(time(0)); srand(time(0));
char *base = basename(cfgfile); char *base = basename(cfgfile);
printf("%s\n", base); //printf("%s\n", base);
network net = parse_network_cfg(cfgfile); network net = parse_network_cfg(cfgfile);
set_batch_network(&net, 1); set_batch_network(&net, 1);
if(weightfile){ if(weightfile){
@ -340,7 +341,7 @@ void test_captcha(char *cfgfile, char *weightfile)
clock_t time; clock_t time;
char filename[256]; char filename[256];
while(1){ while(1){
printf("Enter filename: "); //printf("Enter filename: ");
fgets(filename, 256, stdin); fgets(filename, 256, stdin);
strtok(filename, "\n"); strtok(filename, "\n");
time = clock(); time = clock();
@ -350,7 +351,7 @@ void test_captcha(char *cfgfile, char *weightfile)
float *X = im.data; float *X = im.data;
time=clock(); time=clock();
float *predictions = network_predict(net, X); float *predictions = network_predict(net, X);
printf("Predicted in %f\n", sec(clock() - time)); //printf("Predicted in %f\n", sec(clock() - time));
print_letters(predictions, 10); print_letters(predictions, 10);
free_image(im); free_image(im);
} }

View File

@ -232,6 +232,7 @@ data load_data_detection_jitter_random(int n, char **paths, int m, int classes,
void *load_detection_thread(void *ptr) void *load_detection_thread(void *ptr)
{ {
printf("Loading data: %d\n", rand());
struct load_args a = *(struct load_args*)ptr; struct load_args a = *(struct load_args*)ptr;
*a.d = load_data_detection_jitter_random(a.n, a.paths, a.m, a.classes, a.h, a.w, a.nh, a.nw, a.jitter); *a.d = load_data_detection_jitter_random(a.n, a.paths, a.m, a.classes, a.h, a.w, a.nh, a.nw, a.jitter);
translate_data_rows(*a.d, -128); translate_data_rows(*a.d, -128);