The internals page
chrome://machine-learning-internals contains tools for controlling the ML Service (connecting, disconnecting) and evaluating a subset of models for benchmarking or debugging purposes. To make a new model available here, follow the instructions below.
Adding your model to the internals Web UI page represents a maintenance burden in a couple of ways:
You should only do this if the benefits will outweigh the costs. Here's a discussion of some use cases:
Basically, you need add some html code of your tab to machine_learning_internals.html, and create a
your_model_tab.js file in in chrome/browser/resources/chromeos/machine_learning/. The html code defines the user interface for input and output, and
your_model_tab.js defines the behaviour, like which model id to load, how to compose input tensors and how to extract information from output tensors.
<tabbox> section of machine_learning_internals.html, you need to add a
<tabs> as the title, add a
<tabpanels> as the main part of your tab, then import the
your_model_tab.js file, like:
<tabbox> <tabs> <tab>Your Model</tab> </tabs> <tabpanels> <tabpanel> <!-- elements of the new tab --> </tabpanel> </tabpanels> </tabbox> <script src="your_model_tab.js"></script>
Then you need to register the new-added
your_model_tab.js file in browser_resources.grd by adding an entry for it, like
<include name="IDR_MACHINE_LEARNING_INTERNALS_YOUR_MODEL_TAB_JS" file="resources\chromeos\machine_learning\your_model_tab.js" type="BINDATA" compress="gzip" />
After that, add it to machine_learning_internals_ui.cc, like