Sandwhich

Sandwhich 是一款移动应用,旨在解决三明治辩论,通过机器学习、Flutter 和 TensorFlow Lite 来确定你拍摄的照片是否是三明治。

Sandwhichx

Sandwhich

可在 Google PlayApp Store 上获取

入门

从源代码构建

克隆仓库

git clone https://github.com/MotionMobs/Sandwhich
cd Sandwhich

运行 Sandwhich

flutter run

训练您的模型/如何操作?

要训练您的模型,您需要安装 DockerImageMagick

brew update && brew install imagemagick

设置图像文件结构

training_images
│   ├── input
│   │   ├── not-sandwich
│   │   │   ├── processed  # processed not-sandwich images
│   │   │   └── unprocessed  # original, not yet processed not-sandwich images
│   │   ├── sandwich
│   │   │   ├── processed  # processed sandwich imagess
│   │   │   └── unprocessed  # original, not yet processed sandwich images
│   ├── output  # ready for model
│   │   ├── not-sandwich  # minimum 20 images to train
│   │   └── sandwich  # minimum 20 images to train
└──

将原始图像加载到上述文件夹后,处理这些图像

cd training_images
./conversion.sh

处理完所有图像后,我们需要构建Docker镜像,运行脚本重新训练模型,并运行脚本将重新训练的模型转换为我们可以用于该应用程序的.tflite模型。

返回项目根目录并运行

cd -
./train.sh

请准备好耐心等待。

测试

要测试新模型,请运行 ./test_model.sh $IMAGE_PATH,其中 $IMAGE_PATH 是您要测试的任何图像的路径。为了方便起见,您甚至可以将图像拖到终端中,将其路径放在终端当前内容之后。

  • 当准备好使用新模型时,将其移至assets文件夹并覆盖旧模型。如果需要,请备份旧模型。
  • 运行应用程序,找到一些三明治,然后尽情享用!

在Android上发布

flutter build apk --target-platform android-arm64

GitHub

https://github.com/MotionMobs/Sandwhich