This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'dart:math' as math; | |
class BndBox extends StatelessWidget { | |
final List<dynamic> results; | |
final int previewH; | |
final int previewW; | |
final double screenH; | |
final double screenW; | |
final String model; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:camera/camera.dart'; | |
import 'package:tflite/tflite.dart'; | |
import 'dart:math' as math; | |
typedef void Callback(List<dynamic> list, int h, int w); | |
class Camera extends StatefulWidget { | |
final List<CameraDescription> cameras; | |
final Callback setRecognitions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:camera/camera.dart'; | |
import 'package:tflite/tflite.dart'; | |
import 'dart:math' as math; | |
import 'camera.dart'; | |
import 'bndbox.dart'; | |
import 'models.dart'; | |
class HomePage extends StatefulWidget { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'package:flutter/material.dart'; | |
import 'package:image_picker/image_picker.dart'; | |
import 'package:tflite/tflite.dart'; | |
void main() => runApp(MaterialApp( | |
home: MyApp(), | |
)); | |
class MyApp extends StatefulWidget { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PredictionWidget extends StatelessWidget { | |
final List<Prediction> predictions; | |
const PredictionWidget({Key key, this.predictions}) : super(key: key); | |
Widget _numberWidget(int num, Prediction prediction) { | |
return Column( | |
children: <Widget>[ | |
Text( | |
'$num', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Prediction { | |
final double confidence; | |
final int index; | |
final String label; | |
Prediction({this.confidence, this.index, this.label}); | |
factory Prediction.fromJson(Map<dynamic, dynamic> json) { | |
return Prediction( | |
confidence: json['confidence'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final _canvasCullRect = Rect.fromPoints( | |
Offset(0, 0), | |
Offset(Constants.imageSize, Constants.imageSize), | |
); | |
final _whitePaint = Paint() | |
..strokeCap = StrokeCap.round | |
..color = Colors.white | |
..strokeWidth = Constants.strokeWidth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DrawingPainter extends CustomPainter { | |
final List<Offset> points; | |
DrawingPainter(this.points); | |
final Paint _paint = Paint() | |
..strokeCap = StrokeCap.round | |
..color = Colors.blue | |
..strokeWidth = Constants.strokeWidth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DrawScreen extends StatefulWidget { | |
@override | |
_DrawScreenState createState() => _DrawScreenState(); | |
} | |
class _DrawScreenState extends State<DrawScreen> { | |
final _points = List<Offset>(); | |
final _recognizer = Recognizer(); | |
List<Prediction> _prediction; | |
bool initialize = false; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder