Commit 0241284082d943b8023ba8960fae113a587d5e74
1 parent
0f45059b
pre-load an instance of the landmarker, whitespace fixes
Showing
1 changed file
with
3 additions
and
3 deletions
openbr/plugins/classification/dlib.cpp
| ... | ... | @@ -35,21 +35,21 @@ class DLandmarkerTransform : public UntrainableTransform |
| 35 | 35 | Q_OBJECT |
| 36 | 36 | |
| 37 | 37 | private: |
| 38 | - | |
| 39 | 38 | Resource<shape_predictor> shapeResource; |
| 40 | 39 | |
| 41 | 40 | void init() |
| 42 | 41 | { |
| 43 | 42 | shapeResource.setResourceMaker(new DLibShapeResourceMaker()); |
| 43 | + shapeResource.release(shapeResource.acquire()); // Pre-load one instance of the model | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | QPointF averagePoints(const QList<QPointF> &points, int rangeBegin, int rangeEnd) const |
| 47 | 47 | { |
| 48 | - QPointF point; | |
| 48 | + QPointF point; | |
| 49 | 49 | for (int i=rangeBegin; i<rangeEnd; i++) |
| 50 | 50 | point += points[i]; |
| 51 | 51 | point /= (rangeEnd-rangeBegin); |
| 52 | - return point; | |
| 52 | + return point; | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | void setFacePoints(Template &dst) const | ... | ... |