nochange option in crop

This commit is contained in:
Joseph Redmon 2015-07-13 23:25:08 -07:00
parent 8561e49b5a
commit a47874a7e8
5 changed files with 14 additions and 2 deletions

View File

@ -1,5 +1,5 @@
GPU=0
OPENCV=0
GPU=1
OPENCV=1
DEBUG=0
ARCH= -arch=sm_52

View File

@ -48,6 +48,10 @@ void forward_crop_layer(const crop_layer l, network_state state)
int dw = rand()%(l.w - l.crop_width + 1);
float scale = 2;
float trans = -1;
if(l.noadjust){
scale = 1;
trans = 0;
}
if(!state.train){
flip = 0;
dh = (l.h - l.crop_height)/2;

View File

@ -181,6 +181,10 @@ extern "C" void forward_crop_layer_gpu(crop_layer layer, network_state state)
float scale = 2;
float translate = -1;
if(layer.noadjust){
scale = 1;
translate = 0;
}
int size = layer.batch * layer.w * layer.h;

View File

@ -49,6 +49,7 @@ typedef struct {
int objectness;
int does_cost;
int joint;
int noadjust;
float alpha;
float beta;

View File

@ -196,7 +196,10 @@ crop_layer parse_crop(list *options, size_params params)
batch=params.batch;
if(!(h && w && c)) error("Layer before crop layer must output image.");
int noadjust = option_find_int_quiet(options, "noadjust",0);
crop_layer l = make_crop_layer(batch,h,w,c,crop_height,crop_width,flip, angle, saturation, exposure);
l.noadjust = noadjust;
return l;
}