26 #if defined(DATA_TYPE) && defined(WEIGHT_X) && defined(WEIGHT_Y) && defined(WEIGHT_W) && defined(WEIGHT_H) && defined(IMG_WIDTH) && defined(IMG_HEIGHT) && defined(BOX_FIELDS) && defined(SCALE_BEFORE) // Check for compile time constants 76 const int py = get_global_id(1);
80 delta = vload4(0, (__global DATA_TYPE *)deltas.ptr);
82 box = vload4(0, (__global DATA_TYPE *)
vector_offset(&boxes, BOX_FIELDS * py)) / scale_before;
86 dims = box.s23 - box.s01 + one;
88 ctr = box.s01 + halfone * dims;
90 weights = (
VEC_DATA_TYPE(DATA_TYPE, 4))(WEIGHT_X, WEIGHT_Y, WEIGHT_W, WEIGHT_H);
92 delta.s23 = min(delta.s23, (DATA_TYPE)BBOX_XFORM_CLIP);
96 pred_ctr = delta.s01 * dims + ctr;
98 pred_dims = exp(delta.s23) * dims;
102 max_values = (
VEC_DATA_TYPE(DATA_TYPE, 4))(IMG_WIDTH - 1, IMG_HEIGHT - 1, IMG_WIDTH - 1, IMG_HEIGHT - 1);
110 pred_box = pred_ctr.s0101 + sign * halfone * pred_dims.s0101;
111 #ifdef OFFSET // Possibly adjust the predicted boxes 113 #endif // Possibly adjust the predicted boxes 114 pred_box =
CLAMP(pred_box, min_values, max_values);
115 #ifdef SCALE_AFTER // Possibly scale the predicted boxes 117 #endif // Possibly scale the predicted boxes 120 vstore4(pred_box, 0, (__global DATA_TYPE *)pred_boxes.
ptr);
123 #endif // defined(DATA_TYPE) && defined(WEIGHT_X) && defined(WEIGHT_Y) && defined(WEIGHT_W) && defined(WEIGHT_H) && defined(IMG_WIDTH) && defined(IMG_HEIGHT) && defined(BOX_FIELDS) && defined(SCALE_BEFORE) Structure to hold Vector information.
#define CONVERT_TO_IMAGE_STRUCT(name)
#define IMAGE_DECLARATION(name)
SimpleTensor< T > bounding_box_transform(const SimpleTensor< T > &boxes, const SimpleTensor< TDeltas > &deltas, const BoundingBoxTransformInfo &info)
#define VECTOR_DECLARATION(name)
#define CLAMP(x, min_val, max_val)
Clamp the given value between an upper and lower bound.
Structure to hold Image information.
__global uchar * ptr
Pointer to the starting postion of the buffer.
__global const uchar * vector_offset(const Vector *vec, int x)
Get the pointer position of a Vector.
#define CONVERT_TO_VECTOR_STRUCT_NO_STEP(name)
#define VEC_DATA_TYPE(type, size)