// TODO: Caching, don't read inputs for every inference
public static List<InferenceInOutSequence> getInputOutputAssets(Context context,
            InferenceInOutSequence.FromAssets[] inputOutputAssets,
            InferenceInOutSequence.FromDataset[] inputOutputDatasets) throws IOException {
        // TODO: Caching, don't read inputs for every inference
        List<InferenceInOutSequence> inOutList = new ArrayList<>();
        if (inputOutputAssets != null) {
            for (InferenceInOutSequence.FromAssets ioAsset : inputOutputAssets) {
                inOutList.add(ioAsset.readAssets(context.getAssets()));
            }
        }
        if (inputOutputDatasets != null) {
            for (InferenceInOutSequence.FromDataset dataset : inputOutputDatasets) {
                inOutList.addAll(dataset.readDataset(context.getAssets(), context.getCacheDir()));
            }
        }
        return inOutList;
    }
InferenceInOutSequence.FromAssets[] inputOutputAssets,
InferenceInOutSequence.FromDataset[] inputOutputDatasets) throws IOException {
// TODO: Caching, don't read inputs for every inference
List<InferenceInOutSequence> inOutList = new ArrayList<>();
if (inputOutputAssets != null) {
public static List<InferenceInOutSequence> getInputOutputAssets(Context context,
InferenceInOutSequence.FromAssets[] inputOutputAssets,
InferenceInOutSequence.FromDataset[] inputOutputDatasets) throws IOException {
// TODO: Caching, don't read inputs for every inference
List<InferenceInOutSequence> inOutList = new ArrayList<>();
if (inputOutputAssets != null) {
for (InferenceInOutSequence.FromAssets ioAsset : inputOutputAssets) {
inOutList.add(ioAsset.readAssets(context.getAssets()));
}
}
if (inputOutputDatasets != null) {
for (InferenceInOutSequence.FromDataset dataset : inputOutputDatasets) {
inOutList.addAll(dataset.readDataset(context.getAssets(), context.getCacheDir()));
}
public static List<InferenceInOutSequence> getInputOutputAssets(Context context,
InferenceInOutSequence.FromAssets[] inputOutputAssets,
InferenceInOutSequence.FromDataset[] inputOutputDatasets) throws IOException {
// TODO: Caching, don't read inputs for every inference
List<InferenceInOutSequence> inOutList = new ArrayList<>();
if (inputOutputAssets != null) {
for (InferenceInOutSequence.FromAssets ioAsset : inputOutputAssets) {
inOutList.add(ioAsset.readAssets(context.getAssets()));
}
}
if (inputOutputDatasets != null) {
for (InferenceInOutSequence.FromDataset dataset : inputOutputDatasets) {
inOutList.addAll(dataset.readDataset(context.getAssets(), context.getCacheDir()));
}
}
return inOutList;
}