Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/bndbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class BndBox extends StatelessWidget {
if (_y < difH / 2) h -= (difH / 2 - _y) * scaleH;
}

// points are mirrored when using the front-camera, hence, change x-coords...
x = screenW - x;

return Positioned(
left: math.max(0, x),
top: math.max(0, y),
Expand Down Expand Up @@ -137,7 +140,9 @@ class BndBox extends StatelessWidget {
return Stack(
children: model == mobilenet
? _renderStrings()
: model == posenet ? _renderKeypoints() : _renderBoxes(),
: model == posenet
? _renderKeypoints()
: _renderBoxes(),
);
}
}
5 changes: 4 additions & 1 deletion lib/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class _CameraState extends State<Camera> {
print('No camera is found');
} else {
controller = new CameraController(
widget.cameras[0],
widget.cameras[1],
ResolutionPreset.high,
);
controller.initialize().then((_) {
Expand Down Expand Up @@ -69,6 +69,9 @@ class _CameraState extends State<Camera> {
imageHeight: img.height,
imageWidth: img.width,
numResults: 2,
rotation: -90,
threshold: 0.2,
nmsRadius: 10,
).then((recognitions) {
int endTime = new DateTime.now().millisecondsSinceEpoch;
print("Detection took ${endTime - startTime}");
Expand Down