mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
going to split things up
This commit is contained in:
parent
fb9e0fe336
commit
26cddc6f93
@ -302,7 +302,7 @@ void validate_captcha(char *cfgfile, char *weightfile)
|
||||
}
|
||||
int imgs = 1000;
|
||||
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);
|
||||
data valid = load_data_captcha(paths, imgs, 0, 10, 60, 200);
|
||||
translate_data_rows(valid, -128);
|
||||
@ -329,9 +329,10 @@ void validate_captcha(char *cfgfile, char *weightfile)
|
||||
|
||||
void test_captcha(char *cfgfile, char *weightfile)
|
||||
{
|
||||
setbuf(stdout, NULL);
|
||||
srand(time(0));
|
||||
char *base = basename(cfgfile);
|
||||
printf("%s\n", base);
|
||||
//printf("%s\n", base);
|
||||
network net = parse_network_cfg(cfgfile);
|
||||
set_batch_network(&net, 1);
|
||||
if(weightfile){
|
||||
@ -340,7 +341,7 @@ void test_captcha(char *cfgfile, char *weightfile)
|
||||
clock_t time;
|
||||
char filename[256];
|
||||
while(1){
|
||||
printf("Enter filename: ");
|
||||
//printf("Enter filename: ");
|
||||
fgets(filename, 256, stdin);
|
||||
strtok(filename, "\n");
|
||||
time = clock();
|
||||
@ -350,7 +351,7 @@ void test_captcha(char *cfgfile, char *weightfile)
|
||||
float *X = im.data;
|
||||
time=clock();
|
||||
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);
|
||||
free_image(im);
|
||||
}
|
||||
|
@ -232,6 +232,7 @@ data load_data_detection_jitter_random(int n, char **paths, int m, int classes,
|
||||
|
||||
void *load_detection_thread(void *ptr)
|
||||
{
|
||||
printf("Loading data: %d\n", rand());
|
||||
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);
|
||||
translate_data_rows(*a.d, -128);
|
||||
|
Loading…
Reference in New Issue
Block a user