Skip to content

Commit cf161bc

Browse files
committed
perf(ImageClassifier): use urls directly from teachablemachine
you had to manually add 'model.json' to the url and its confusing for beginners
1 parent 6d59c1a commit cf161bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ImageClassifier/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ class ImageClassifier {
6565
this.modelToUse = null;
6666
}
6767
} else {
68+
// its a url, we expect to find model.json
6869
this.modelUrl = modelNameOrUrl;
70+
// The teachablemachine urls end with a slash, so add model.json to complete the full path
71+
if (this.modelUrl.endsWith('/')) this.modelUrl += "model.json";
6972
}
7073
}
7174
// Load the model

0 commit comments

Comments
 (0)