| | |
| | | { |
| | | char *labelpath = find_replace(path, "images", "labels"); |
| | | labelpath = find_replace(labelpath, "JPEGImages", "labels"); |
| | | |
| | | labelpath = find_replace(labelpath, ".jpg", ".txt"); |
| | | labelpath = find_replace(labelpath, ".JPG", ".txt"); |
| | | labelpath = find_replace(labelpath, ".JPEG", ".txt"); |
| | | int count = 0; |
| | | box_label *boxes = read_boxes(labelpath, &count); |
| | |
| | | check_error(status); |
| | | #endif |
| | | |
| | | printf("Loading data: %d\n", rand_r(&data_seed)); |
| | | //printf("Loading data: %d\n", rand_r(&data_seed)); |
| | | load_args a = *(struct load_args*)ptr; |
| | | if (a.type == CLASSIFICATION_DATA){ |
| | | *a.d = load_data(a.paths, a.n, a.m, a.labels, a.classes, a.w, a.h); |
| | |
| | | pthread_t thread; |
| | | struct load_args *ptr = calloc(1, sizeof(struct load_args)); |
| | | *ptr = args; |
| | | if(pthread_create(&thread, 0, load_thread, ptr)) { |
| | | error("Thread creation failed"); |
| | | } |
| | | if(pthread_create(&thread, 0, load_thread, ptr)) error("Thread creation failed"); |
| | | return thread; |
| | | } |
| | | |