Avatar for ThomasVikström

ThomasVikström

Member since Dec 2016 • Last active Oct 2021
  • 4 conversations
  • 45 comments

Most recent activity

  • in Bangle.js
    Avatar for ThomasVikström

    Well, ask 10 persons and you'll get 20 answers :-)
    To me the easiest to read is the one with 2nd biggest one and bolded. Now, this is said without having a clue how small the text will be on the watch display itself. As a side note, on Bangle v1 the date with the default watch face is completely unreadable for me, even with reading glasses, only a magnifying glass can help me read the date.
    I'd also appreciate if the text would not be "touching" the frame, is it possible to add a couple of pixels margin?

  • in Bangle.js
    Avatar for ThomasVikström

    Makes sense, at least it does not crash now, instead gives me a value.
    Great! I'll try out this way of handling tf-files, if I get a holistic understanding of this, I might create/update a tutorial on it as well.

  • in Bangle.js
    Avatar for ThomasVikström

    var model = require("Storage").read("mytfmodel");

    var tf = require("tensorflow").create(2048, model);
    tf.getInput()[0] = x;
    tf.invoke();
    print(tf.getOutput()[0]);

    Hi - Thx, this makes sense now once I saw it, am new to JS! However, it produces the below error. I've uploaded the same tfmodel file used with the gesture functions to the watch and named it mytfmodel
    Does this perhaps mean that the tfmodel file should be converted to a flat string? In that case, can that be done with JS?

    >Uncaught TypeError: Model is not a Flat String/ArrayBuffer
     at line 2 col 50
    var tf = require("tensorflow").create(2048, model);
                                                     ^
    Uncaught Error: Cannot read property 'getInput' of undefined
     at line 3 col 3
    tf.getInput()[0] = x;
      ^
    Uncaught Error: Cannot read property 'invoke' of undefined
     at line 4 col 3
    tf.invoke();
      ^
    Uncaught Error: Cannot read property 'getOutput' of undefined
     at line 5 col 9
    print(tf.getOutput()[0]);
            ^
    > 
    
  • in Bangle.js
    Avatar for ThomasVikström

    Thx for the comments!
    As I have a .tfmodel file exported from Edge Impulse, I’d like to use that but I’m not sure how to read it with JS and if it needs conversion before.
    The same .tfmodel file works as such with the Bangle gesture functions.

    @Gordon I guess you are superbusy with the Kickstarter campaign right now. When you get time, could you please shed some light on how to use a .tfmodel file created by an external system in Javascript.
    I.e., like in the code in post #9 above, how should the .tfmodel-file be "introduced" into the code? As the Bangle gesture functions can use it, I guess there should be a way to use it within JS also?

  • in Bangle.js
    Avatar for ThomasVikström

    Ok, updated from a 2 week old firmware (2v10.something) to the latest 2v10.107.
    Now it is not crashing anymore!

  • in Bangle.js
    Avatar for ThomasVikström

    Hmm, the below code is copied from here and just slightly appended. When running it, Bangle restarts itself, when tf.invoke() is run.
    What is amiss here, the code, or me?

    Edit 1: While the code resets the physical watch, it runs fine in the emulator, both for Bangle 1 and 2
    Edit 2: Tried to reset the watch by installing default apps, still same problem

    var model=atob("GAAAAFRGTDMAAA4AGAAEAAgADAAQ­ABQADgAAAAMAAADsCQAAuAUAAKAFAAAEAAAACwAA­AJAFAAB8BQAAJAUAANQEAADMBAAAxAQAALwEAABs­BAAAXAAAAAwAAAAEAAAAePb//7b6//8EAAAAQAAA­AJ4IZD5QVk0+7cXIPkq+Er8xYmi8i2/MPqSmNL4q­Z529BkrJPsPwij08RhC/GISaPuFzVD5EElI+BF7y­vgBVWz4C+///BAAAAAAEAADy1BE+hO4/PpbYQL5l­m62+Of0OvqzJgT6emCU+N++UvGqNxr4E0iC+4KYU­PWwbhb5x7CC9a6WBPqhwhb5h/qw+nsY4vtWAXb6M­jwa8fL+nPfqwjj4yjtU8vxOaPpw0Tj643ZQ+dEUk­PCglib1csyS+V3pqPm3mj75NqYs+sw0xPucVkb4s­MBm+Fy3DPbxymL3qREg+7ZoVvowzlz0K6sm+lNNo­PmBunr2AD6i8St+MvgJSlD4awpw+1JWxvhaUv7xr­opi+lvRdPX9dkr6rZKy+rv/LPngF7L5YDX89OhGd­Pl5g1L5tvj2+4Ol1PQZm273xFcM9Gyq0PnMCuD4k­pDy/kV5svk89SD/TlMY9fCvWvo7gej1gHou/MkCC­vmLRGD++MdG7ugULv/cOhL74yme/w3mIvVy3jT2/­a6k+MgrFvqiPzb1Hgt49c3a5PiUNWL5SGq4+0RRv­PnKPKT6wWhw/F4r3PS0LyrwP4dy+snCYPuusFb6D­8AW/FpNrvuegab4q+Mk+Noa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lT3AvdHJhbnNwb3NlAAAC­AAAAEAAAABAAAADK/v//MAAAAAoAAAAMAAAABAAA­ALz+//8VAAAAc2VxdWVudGlhbC9kZW5zZS9SZWx1­AAAAAgAAAAEAAAAQAAAACv///zgAAAADAAAADAAA­AAQAAAD8/v//HAAAAHNlcXVlbnRpYWwvZGVuc2Uv­TWF0TXVsX2JpYXMAAAAAAQAAABAAAABO////TAAA­AAkAAAAMAAAABAAAAED///8wAAAAc2VxdWVudGlh­bC9kZW5zZS9NYXRNdWwvUmVhZFZhcmlhYmxlT3Av­dHJhbnNwb3NlAAAAAAIAAAAQAAAAAQAAAKr///9E­AAAABQAAACwAAAAMAAAACAAMAAQACAAIAAAAEAAA­AAQAAAABAAAAAAB/QwEAAAAAAAAACwAAAGRlbnNl­X2lucHV0AAIAAAABAAAAAQAAAAAADgAUAAQAAAAI­AAwAEAAOAAAAKAAAAAYAAAAQAAAACAAAAAQABAAE­AAAACAAAAElkZW50aXR5AAAAAAIAAAABAAAAAQAA­AAEAAAAQAAAAAAAKAAwABwAAAAgACgAAAAAAAAkD­AAAA");
    
    var x = 1;
    
    var tf = require("tensorflow").create(2048, model);
    print ("1");
    tf.getInput()[0] = x;
    
    print ("2");
    tf.invoke();
    
    print ("3");
    print(tf.getOutput()[0]);
    
    print ("4");
    
  • in Bangle.js
    Avatar for ThomasVikström

    Hi @user130273, would you be willing to share your code? I've been able to collect data and train a model using Edge Impulse (if interested, see this tutorial I wrote). This is however using the Bangle gesture commands, but now I'd like to learn how to use raw accelerometer and other data.
    Especially this part is unclear: when I've uploaded a trained model (.tfmodel + .tfnames) to the watch, how can I run inference code on it?

    Edit: Aargh, it should be something in line with the below code that I've seen many times... Still interested to see your code though.

    var model=atob("......");
    
    var tf = require("tensorflow").create(2048, model);
    tf.getInput()[0] = x;
    tf.invoke();
    print(tf.getOutput()[0]);
    
Actions