mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
nochange option in crop
This commit is contained in:
parent
8561e49b5a
commit
a47874a7e8
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -49,6 +49,7 @@ typedef struct {
|
||||
int objectness;
|
||||
int does_cost;
|
||||
int joint;
|
||||
int noadjust;
|
||||
|
||||
float alpha;
|
||||
float beta;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user