Today, we are introducing the currently supports six ML tasks including Vision and NLP use cases. Here is the brief introduction for each of them.
Object detectors can identify which of a known set of objects might be present and provide information about their positions within the given image or a video stream. TheObjectDetectorAPI supports similar image processing options asImageClassifer. The output is a list of the top-k detected objects with label, bounding box, and probability.- &
BertQuestionAnswerer loads a BERT model and answers question based on the content of a given passage. It currently supports . Similar to BertNLClassifier, BertQuestionAnswerer encapsulates complex tokenization processing for input text. You can simply pass in contexts and questions in string to BertQuestionAnswerer.
Supported Models
The Task Library is compatible with the following known sources of models:- TensorFlow Hub Task Library model collections ( / ).
- Models created by .
Run inference with the Task Library
The Task Library works cross-platform and is supported on (experimental), and to segment an airplane image (Figure 1) in Android as follows:// Create the API from a model file and options
String modelPath = "path/to/model.tflite"
ImageSegmenterOptions options = ImageSegmenterOptions.builder().setOutputType(OutputType.CONFIDENCE_MASK).build();
ImageSegmenter imageSegmenter = ImageSegmenter.createFromFileAndOptions(context, modelPath, options);
// Segment an image
TensorImage image = TensorImage.fromBitmap(bitmap);
List results = imageSegmenter.segment(image); | Figure 2. Segmented mask. |
Swift is supported for the three text APIs. To perform Question and Answer in iOS with the for more details.
Future Work
We will continue improving the user experience for the Task Library. Here is the roadmap for the near future:- Improve the usability of the C++ Task Library, such as providing prebuilt binaries and creating user-friendly workflows for users who want to build from source code.
- Publish reference examples using the Task Library.
- Enable more machine learning use cases via new task types.
- Improve cross-platform support and enable more tasks for iOS.
Feedback
We would love to hear your feedback, and suggestions for newer use cases to be supported in the Task Library. Please email [email protected] or create a TensorFlow Lite support GitHub issue.Acknowledgments
This work would not have been possible without the efforts of- Cédric Deltheil and Maxime Brénon, the main contributors for the Task Library Vision API.
- Chen Cen, the main contributor for the Task Library native/Android/iOS infrastructure and Text API.
- Xunkai and YoungSeok Yoon, the main contributors for the dev infra and releasing process.
SOCIAL SHARE CARD GENERATOR