pytorch_lite 1.1.0 copy "pytorch_lite: ^1.1.0" to clipboard
pytorch_lite: ^1.1.0 copied to clipboard

outdated

Flutter package to help run pytorch lite models classification and yolov5

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:pytorch_lite_example/RunModelByCameraDemo.dart';
import 'package:pytorch_lite_example/RunModelByImageDemo.dart';

void main() => runApp(ChooseDemo());

class ChooseDemo extends StatefulWidget {
  const ChooseDemo({Key? key}) : super(key: key);

  @override
  State<ChooseDemo> createState() => _ChooseDemoState();
}

class _ChooseDemoState extends State<ChooseDemo> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Pytorch Mobile Example'),
        ),
        body: Builder(
          builder: (context) {
            return Center(
              child: Column(
                children: [
                  TextButton(
                    onPressed: () => {
                      Navigator.push(
                        context,
                        MaterialPageRoute(builder: (context) => RunModelByCameraDemo()),
                      )
                    },
                    style: TextButton.styleFrom(
                      backgroundColor: Colors.blue,
                    ),
                    child: Text(
                      "Run Model with Camera",
                      style: TextStyle(
                        color: Colors.white,
                      ),
                    ),
                  ),
                  TextButton(
                    onPressed: () => {
                      Navigator.push(
                        context,
                        MaterialPageRoute(builder: (context) => RunModelByImageDemo()),
                      )
                    },
                    style: TextButton.styleFrom(
                      backgroundColor: Colors.blue,
                    ),
                    child: Text(
                      "Run Model with Image",
                      style: TextStyle(
                        color: Colors.white,
                      ),
                    ),
                  )
                ],
              ),
            );
          }
        ),
      ),
    );
  }
}
37
likes
0
pub points
85%
popularity

Publisher

verified publisherzcreations.info

Flutter package to help run pytorch lite models classification and yolov5

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, path, path_provider

More

Packages that depend on pytorch_lite