How to use my Huggingface model in Kotlin app (production, MVP)?

You can convert your model to ONNX, TFLite or Torchscript. There’s an informative thread over here: From simple imageClassification model to android/ios app? - #7 by dnth

With respect to the “out of domain” question, there’s three options (top of my head):

  1. hope the model predicts out of domain images with low confidence, but I have rarely seen this to be the case.
  2. Create an additional category filled with out of domain images. Could work, but creates the burden of deciding what images go into that category.
  3. Use BCEWithLogitsLossFlat loss, there’s good write up in walkwithfastai: Lesson 3 - Unknown Labels (Pets Revisited) | walkwithfastai

Curious to know the results :slight_smile:

1 Like