text
stringlengths 0
2.2M
|
---|
mean average error of the detector. In fact, The \n\
|
return value of this function is identical to that of dlib's \n\
|
shape_predictor_trainer() routine. Therefore, see the documentation \n\
|
for shape_predictor_trainer() for a detailed definition of the mean average error.");
|
m.def("test_shape_predictor", test_shape_predictor_with_images_no_scales_py,
|
py::arg("images"), py::arg("detections"), py::arg("shape_predictor"),
|
"requires \n\
|
- len(images) == len(object_detections) \n\
|
- images should be a list of numpy matrices that represent images, either RGB or grayscale. \n\
|
- object_detections should be a list of lists of dlib.full_object_detection objects. \
|
Each dlib.full_object_detection contains the bounding box and the lists of points that make up the object parts.\n\
|
ensures \n\
|
- shape_predictor should be a file produced by the train_shape_predictor() \n\
|
routine. \n\
|
- This function tests the predictor against the dataset and returns the \n\
|
mean average error of the detector. In fact, The \n\
|
return value of this function is identical to that of dlib's \n\
|
shape_predictor_trainer() routine. Therefore, see the documentation \n\
|
for shape_predictor_trainer() for a detailed definition of the mean average error.");
|
m.def("test_shape_predictor", test_shape_predictor_with_images_py,
|
py::arg("images"), py::arg("detections"), py::arg("scales"), py::arg("shape_predictor"),
|
"requires \n\
|
- len(images) == len(object_detections) \n\
|
- len(object_detections) == len(scales) \n\
|
- for every sublist in object_detections: len(object_detections[i]) == len(scales[i]) \n\
|
- scales is a list of floating point scales that each predicted part location \
|
should be divided by. Useful for normalization. \n\
|
- images should be a list of numpy matrices that represent images, either RGB or grayscale. \n\
|
- object_detections should be a list of lists of dlib.full_object_detection objects. \
|
Each dlib.full_object_detection contains the bounding box and the lists of points that make up the object parts.\n\
|
ensures \n\
|
- shape_predictor should be a file produced by the train_shape_predictor() \n\
|
routine. \n\
|
- This function tests the predictor against the dataset and returns the \n\
|
mean average error of the detector. In fact, The \n\
|
return value of this function is identical to that of dlib's \n\
|
shape_predictor_trainer() routine. Therefore, see the documentation \n\
|
for shape_predictor_trainer() for a detailed definition of the mean average error.");
|
}
|
}
|
//
|
// Copyright (c) 2009-2010 Mikko Mononen [email protected]
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
//
|
#include "DetourCommon.h"
|
#include "DetourMath.h"
|
#include "DetourStatus.h"
|
#include "DetourAssert.h"
|
#include "DetourTileCacheBuilder.h"
|
#include <string.h>
|
template<class T> class dtFixedArray
|
{
|
dtTileCacheAlloc* m_alloc;
|
T* m_ptr;
|
const int m_size;
|
inline void operator=(dtFixedArray<T>& p);
|
public:
|
inline dtFixedArray(dtTileCacheAlloc* a, const int s) : m_alloc(a), m_ptr((T*)a->alloc(sizeof(T)*s)), m_size(s) {}
|
inline ~dtFixedArray() { if (m_alloc) m_alloc->free(m_ptr); }
|
inline operator T*() { return m_ptr; }
|
inline int size() const { return m_size; }
|
};
|
inline int getDirOffsetX(int dir)
|
{
|
const int offset[4] = { -1, 0, 1, 0, };
|
return offset[dir&0x03];
|
}
|
inline int getDirOffsetY(int dir)
|
{
|
const int offset[4] = { 0, 1, 0, -1 };
|
return offset[dir&0x03];
|
}
|
static const int MAX_VERTS_PER_POLY = 6; // TODO: use the DT_VERTS_PER_POLYGON
|
static const int MAX_REM_EDGES = 48; // TODO: make this an expression.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.