Git Product home page Git Product logo

Comments (6)

parai avatar parai commented on August 19, 2024 2

Hi:
I have created a DMS demo that use GazeML, here is the code that show how GazeML was used, https://github.com/parai/dms/blob/master/models/gaze.py.

from gazeml.

swook avatar swook commented on August 19, 2024 1

Hi many apologies for taking so long to reply to this...

To be honest it's because I don't have a straight-forward solution for a simple way to do inference. What I recommend is to copy the model code to a simpler code-base for yourself, then load the checkpoints.

I use tf.Saver to load model parameters. See https://github.com/swook/GazeML/blob/master/src/core/checkpoint_manager.py#L47

The restoring occurs based on the tf.variable_scope definitions and thus naming of various tensors. So I recommend keeping the neural net spec. as it is.

from gazeml.

WuZhuoran avatar WuZhuoran commented on August 19, 2024

Of course, in tensorflow, it could be:

with tf.Session(...) as sess:
    tf.saved_model.loader.load(sess, ...)
    sess.run('myOutput:0',
               feed_dict={'myInput:0': ...

Can i first decode image into tensor:

img_tensor = tf.image.decode_image(img_raw)

Then feed the tensor to the model?

from gazeml.

WuZhuoran avatar WuZhuoran commented on August 19, 2024

I found the code in inverence_generator.py

data_source = next(iter(self._train_data.values()))
while True:
      fetches = dict(self.output_tensors['train'], **data_source.output_tensors)
      start_time = time.time()
      outputs = self._tensorflow_session.run(
      fetches=fetches,
       feed_dict={
            self.is_training: False,
            self.use_batch_statistics: True,
        },
       )
     outputs['inference_time'] = 1e3*(time.time() - start_time)
      yield outputs

This fetch from datasource, right? How about for a single image? could we inference with out put image into datasource?

Thank you

from gazeml.

WuZhuoran avatar WuZhuoran commented on August 19, 2024

According to your paper and output or training, there are 2 models, first is hourglass, the other is densenet. Now I already trained the models. How to load and run?

Thank you for your help.

from gazeml.

yuqwang913 avatar yuqwang913 commented on August 19, 2024

Hi! I am also facing with same problem. How do you fix it?

from gazeml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.