I am trying to get a webgl app from this github repo: https://github.com/terryky/tfjs_webgl_app working, but I am running into some issues. I would like to use the full-body blazepose model.
I cloned the repo, and just clicked index.html
. Firefox shows me a dialog that says: "failed to load model", which is coming from this piece of code in tfjs_blazepose.js
:
init_tfjs_blazepose ()
{
try {
let url = "./model/tfjs_model_full_pose_detection_float32/model.json";
s_detect_model = await tf.loadGraphModel(url);
let url_landmark = "./model/tfjs_model_full_pose_landmark_39kp_float32/model.json";
s_landmark_model = await tf.loadGraphModel(url_landmark);
}
catch (e) {
alert ("failed to load model");
alert (e.message)
}
(index.html
calls startWebGL();
in webgl_main.js
, which in turn contains the line await init_tfjs_blazepose
)
After that message, Firefox presents me with another window containing the error message: "NetworkError when attempting to fetch resource." Looking at other people experiencing this error, I have not yet been able to find the similarities.
My assumption is that something is going wrong with the tf.loadGraphModel function, resulting in this error message, but I am not sure where to look for the problem.
I am running Ubuntu 18.04. I am experiencing some problems with the npm install
command right now, so I do not have tfjs installed. From looking here (https://www.tensorflow.org/js/tutorials/setup) however, I assumed this would not be necessary, since these lines are included in the index.html
file:
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-converter"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js"></script>
I have close to zero experience with js in general, so I have the feeling I am just missing some dependencies or something of that nature which might be obvious to you. Any advice would be much appreciated.