| | |
| | | time=clock(); |
| | | float loss = train_network(net, train); |
| | | |
| | | //TODO |
| | | float *out = get_network_output_gpu(net); |
| | | image im = float_to_image(net.w, net.h, 3, train.X.vals[127]); |
| | | image copy = copy_image(im); |
| | |
| | | if(weightfile){ |
| | | load_weights(&net, weightfile); |
| | | } |
| | | detection_layer *layer = get_network_detection_layer(net); |
| | | detection_layer layer = get_network_detection_layer(net); |
| | | net.learning_rate = 0; |
| | | net.decay = 0; |
| | | printf("Learning Rate: %g, Momentum: %g, Decay: %g\n", net.learning_rate, net.momentum, net.decay); |
| | |
| | | int i = net.seen/imgs; |
| | | data train, buffer; |
| | | |
| | | int classes = layer->classes; |
| | | int background = layer->background; |
| | | int side = sqrt(get_detection_layer_locations(*layer)); |
| | | int classes = layer.classes; |
| | | int background = layer.background; |
| | | int side = sqrt(get_detection_layer_locations(layer)); |
| | | |
| | | char **paths; |
| | | list *plist; |
| | |
| | | paths = (char **)list_to_array(plist); |
| | | pthread_t load_thread = load_data_detection_thread(imgs, paths, plist->size, classes, net.w, net.h, side, side, background, &buffer); |
| | | clock_t time; |
| | | cost_layer clayer = *((cost_layer *)net.layers[net.n-1]); |
| | | cost_layer clayer = net.layers[net.n-1]; |
| | | while(1){ |
| | | i += 1; |
| | | time=clock(); |
| | |
| | | if(weightfile){ |
| | | load_weights(&net, weightfile); |
| | | } |
| | | detection_layer *layer = get_network_detection_layer(net); |
| | | detection_layer layer = get_network_detection_layer(net); |
| | | printf("Learning Rate: %g, Momentum: %g, Decay: %g\n", net.learning_rate, net.momentum, net.decay); |
| | | int imgs = 128; |
| | | int i = net.seen/imgs; |
| | | data train, buffer; |
| | | |
| | | int classes = layer->classes; |
| | | int background = layer->background; |
| | | int side = sqrt(get_detection_layer_locations(*layer)); |
| | | int classes = layer.classes; |
| | | int background = layer.background; |
| | | int side = sqrt(get_detection_layer_locations(layer)); |
| | | |
| | | char **paths; |
| | | list *plist; |
| | |
| | | float y = (pred.vals[j][ci + 1] + row)/num_boxes; |
| | | float w = pred.vals[j][ci + 2]; //* distance_from_edge(row, num_boxes); |
| | | float h = pred.vals[j][ci + 3]; //* distance_from_edge(col, num_boxes); |
| | | w = w*w; |
| | | h = h*h; |
| | | w = pow(w, 1); |
| | | h = pow(h, 1); |
| | | float prob = scale*pred.vals[j][k+class+background+nuisance]; |
| | | if(prob < threshold) continue; |
| | | printf("%d %d %f %f %f %f %f\n", offset + j, class, prob, x, y, w, h); |
| | |
| | | if(weightfile){ |
| | | load_weights(&net, weightfile); |
| | | } |
| | | detection_layer *layer = get_network_detection_layer(net); |
| | | detection_layer layer = get_network_detection_layer(net); |
| | | fprintf(stderr, "Learning Rate: %g, Momentum: %g, Decay: %g\n", net.learning_rate, net.momentum, net.decay); |
| | | srand(time(0)); |
| | | |
| | |
| | | //list *plist = get_paths("/home/pjreddie/data/voc/train.txt"); |
| | | char **paths = (char **)list_to_array(plist); |
| | | |
| | | int classes = layer->classes; |
| | | int nuisance = layer->nuisance; |
| | | int background = (layer->background && !nuisance); |
| | | int num_boxes = sqrt(get_detection_layer_locations(*layer)); |
| | | int classes = layer.classes; |
| | | int nuisance = layer.nuisance; |
| | | int background = (layer.background && !nuisance); |
| | | int num_boxes = sqrt(get_detection_layer_locations(layer)); |
| | | |
| | | int per_box = 4+classes+background+nuisance; |
| | | int num_output = num_boxes*num_boxes*per_box; |
| | |
| | | load_weights(&post, "/home/pjreddie/imagenet_backup/localize_1000.weights"); |
| | | set_batch_network(&post, 1); |
| | | |
| | | detection_layer *layer = get_network_detection_layer(net); |
| | | detection_layer layer = get_network_detection_layer(net); |
| | | fprintf(stderr, "Learning Rate: %g, Momentum: %g, Decay: %g\n", net.learning_rate, net.momentum, net.decay); |
| | | srand(time(0)); |
| | | |
| | |
| | | //list *plist = get_paths("/home/pjreddie/data/voc/train.txt"); |
| | | char **paths = (char **)list_to_array(plist); |
| | | |
| | | int classes = layer->classes; |
| | | int nuisance = layer->nuisance; |
| | | int background = (layer->background && !nuisance); |
| | | int num_boxes = sqrt(get_detection_layer_locations(*layer)); |
| | | int classes = layer.classes; |
| | | int nuisance = layer.nuisance; |
| | | int background = (layer.background && !nuisance); |
| | | int num_boxes = sqrt(get_detection_layer_locations(layer)); |
| | | |
| | | int per_box = 4+classes+background+nuisance; |
| | | |