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
4
Makefile
4
Makefile
@ -1,5 +1,5 @@
|
|||||||
GPU=0
|
GPU=1
|
||||||
OPENCV=0
|
OPENCV=1
|
||||||
DEBUG=0
|
DEBUG=0
|
||||||
|
|
||||||
ARCH= -arch=sm_52
|
ARCH= -arch=sm_52
|
||||||
|
@ -48,6 +48,10 @@ void forward_crop_layer(const crop_layer l, network_state state)
|
|||||||
int dw = rand()%(l.w - l.crop_width + 1);
|
int dw = rand()%(l.w - l.crop_width + 1);
|
||||||
float scale = 2;
|
float scale = 2;
|
||||||
float trans = -1;
|
float trans = -1;
|
||||||
|
if(l.noadjust){
|
||||||
|
scale = 1;
|
||||||
|
trans = 0;
|
||||||
|
}
|
||||||
if(!state.train){
|
if(!state.train){
|
||||||
flip = 0;
|
flip = 0;
|
||||||
dh = (l.h - l.crop_height)/2;
|
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 scale = 2;
|
||||||
float translate = -1;
|
float translate = -1;
|
||||||
|
if(layer.noadjust){
|
||||||
|
scale = 1;
|
||||||
|
translate = 0;
|
||||||
|
}
|
||||||
|
|
||||||
int size = layer.batch * layer.w * layer.h;
|
int size = layer.batch * layer.w * layer.h;
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ typedef struct {
|
|||||||
int objectness;
|
int objectness;
|
||||||
int does_cost;
|
int does_cost;
|
||||||
int joint;
|
int joint;
|
||||||
|
int noadjust;
|
||||||
|
|
||||||
float alpha;
|
float alpha;
|
||||||
float beta;
|
float beta;
|
||||||
|
@ -196,7 +196,10 @@ crop_layer parse_crop(list *options, size_params params)
|
|||||||
batch=params.batch;
|
batch=params.batch;
|
||||||
if(!(h && w && c)) error("Layer before crop layer must output image.");
|
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);
|
crop_layer l = make_crop_layer(batch,h,w,c,crop_height,crop_width,flip, angle, saturation, exposure);
|
||||||
|
l.noadjust = noadjust;
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user