Joseph Redmon
2015-07-20 38bd6ae6ba24fc8c14fd61d1238ae94a983434b3
src/crop_layer_kernels.cu
@@ -114,9 +114,9 @@
    size_t offset = id * h * w * 3;
    image += offset;
    float r = image[x + w*(y + h*2)];
    float r = image[x + w*(y + h*0)];
    float g = image[x + w*(y + h*1)];
    float b = image[x + w*(y + h*0)];
    float b = image[x + w*(y + h*2)];
    float3 rgb = make_float3(r,g,b);
    if(train){
        float3 hsv = rgb_to_hsv_kernel(rgb);
@@ -124,9 +124,9 @@
        hsv.z *= exposure;
        rgb = hsv_to_rgb_kernel(hsv);
    }
    image[x + w*(y + h*2)] = rgb.x*scale + translate;
    image[x + w*(y + h*0)] = rgb.x*scale + translate;
    image[x + w*(y + h*1)] = rgb.y*scale + translate;
    image[x + w*(y + h*0)] = rgb.z*scale + translate;
    image[x + w*(y + h*2)] = rgb.z*scale + translate;
}
__global__ void forward_crop_layer_kernel(float *input, float *rand, int size, int c, int h, int w, int crop_height, int crop_width, int train, int flip, float angle, float *output)
@@ -181,6 +181,10 @@
    float scale = 2;
    float translate = -1;
    if(layer.noadjust){
        scale = 1;
        translate = 0;
    }
    int size = layer.batch * layer.w * layer.h;