Coder Social home page Coder Social logo

toniz / deeplab-on-ios Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 5.0 2.6 MB

Tensorflow-lite Deeplab Real Time Segmentation on iOS with OpenCV

License: MIT License

Swift 22.74% Objective-C 17.84% Objective-C++ 57.12% Ruby 2.29%
deeplab opencv realtime segmentation tensorflow-lite

deeplab-on-ios's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

deeplab-on-ios's Issues

slow segmentation with deeplab

@toniz
Hi, I have trained deep lab on my custom dataset(50*50,3400 images) for iris eyes object with 257 as crop size and during the test, it detects for crop with crop size 257 .
i tested the pb model with code python it detects ok
2019-07-25

now what I need is to integrate my model on ios application, i was able to successfully convert the model to tflite .but it gives me a slow segmentation
tflite_convert ----output_format=TFLITE --inference_type=FLOAT --inference_input_type=FlOAT --input_arrays=sub_2 --input_shapes=1,257,257,3 --output_arrays=ResizeBilinear_2 --output_file=/Users/hak/Downloads/deeplabv3_mnv2_pascal_trainvall/mobilenet.tflite --graph_def=/Users/hak/Downloads/deeplabv3_mnv2_pascal_trainvall/mobilenet.pb --mean_values=128 --std_dev_values=127 --allow_custom_ops --post_training_quantize
tflite file size=2,2mo
however the original deeplab tflite file works fine on the appliacation
i have changed fps to 60 and to 240 but nothing change
i use iphone6+

intgrate new model with the code

@toniz
thnx for the project, it was really helpful for me, i have tried to put my retrained model on the code but I got an error if you don't mind can you check it with me??

error > EXC_BAD_ACCESS

i have trained deeplab model on new object and its work with detection
i was able to successfully convert the model with the following command:
toco --output_file=model.tflite --input_file=prozen_inference_graph.pb --input_arrays=ImageTensor --output_arrays=SemanticPredictions --input_shapes=1,513,513,3 --inference_input_type=QUANTIZED_UINT8 --inference_type=FLOAT --mean_values=128 --std_dev_values=127 --allow_custom_ops --post_training_quantize
Sans titre 2

deeplab detects badly on ios

@toniz
Hi, I have trained deep lab on my custom dataset(400*300,14000 images) for iris eyes object with 513 as crop size and during the test, it detects for crop with crop size 513 .
i tested the pb model with code python it detects ok(not precise very much but it ok)
now what I need i integrate my model on ios application, i was able to successfully convert the model to tflite .but it gives me a wrong and bad segmentation
python train.py \ --logtostderr \ --train_split="trainval" \ --model_variant="mobilenet_v2" \ --output_stride=16 \ --train_crop_size="513,513" \ --train_batch_size=4 \ --training_number_of_steps=20000 \ --fine_tune_batch_norm=true \ --tf_initial_checkpoint="${INIT_FOLDER}/${CKPT_NAME}/model.ckpt-30000" \ --train_logdir="${TRAIN_LOGDIR}" \ --dataset_dir="${my_DATASET}"
####convert to tflite
tflite_convert ----output_format=TFLITE --inference_type=QUANTIZED_UINT8 --inference_input_type=FlOAT --input_arrays=sub_2 --input_shapes=1,513,513,3 --output_arrays=ResizeBilinear_2 --output_file=/Users/hak/Downloads/deeplabv3_mnv2_pascal_trainvall/mobilenet1-20000.tflite --graph_def=/Users/hak/Downloads/deeplabv3_mnv2_pascal_trainvall/mobilenet-20000.pb --mean_values=128 --std_dev_values=127 --allow_custom_ops --post_training_quantize
did you have any idea why mobilenet gives me such bad result is't the training steps no enough for 14000 images or what ??

`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.