Comments (23)
from eye-tracker.
@sathiez To test the trained model: run python itracker_adv.py -i input_data -lm saved_model
from eye-tracker.
@hugochan can you please give some information about the input_data. in what format shall we provide the data. do we have to provide the data in .tar file as we downloaded or do we have to provide in raw format
from eye-tracker.
@youngsterali Just use the raw format which is a numpy .npz file.
from eye-tracker.
@hugochan Thank you
from eye-tracker.
Hi, Can you please explain, how to predict the position, using trained models? Thank you.
from eye-tracker.
@Safiullahmarwat you can get the prediction by evaluating the pred
ops here
from eye-tracker.
Thank you.
Just sorted out. this is a parameter for prediction. i meant this one.
Predicted_Position = session.run(pred, feed_dict={eye_left: batch_val_data[0], \
eye_right: batch_val_data[1], face: batch_val_data[2], \
face_mask: batch_val_data[3], y: batch_val_data[4]})
you actually pointing toward a parameter, instead of exact answer, suitable for newbies (like me :P)
I think @sathiez also searched for the same answer.
from eye-tracker.
Is it possible to share the script for dataset preparation? I want to prepare dataset from my own images? that shall be very helpful. Thanks in advance.
[Edit:] Here is the script, I think. https://github.com/gdubrg/Eye-Tracking-for-Everyone
from eye-tracker.
@Safiullahmarwat unfortunately, I do not have the script for dataset preparation. I used the preprocessed data shared by others. I suggest you to contact the original authors.
from eye-tracker.
@hugochan If I want to extract the output of each layer, is there any way out? please tell me in the perspective of your code, although I know its not specific to your code. e.g if i input an image, i want to see the output of first layer.
from eye-tracker.
@bryanhpchiang thank you. but still have bit confusion. e.g in the code iTracker_adv if I want to have an output at line 174. what will be the right way to get the out put? because i think it require a layer name, but here we dont have specific name here, right? so help please :)
from eye-tracker.
If you want the output after this line (https://github.com/hugochan/Eye-Tracker/blob/master/itracker_adv.py#L173), just change pred to left_eye in the following code.
Thank you.
Just sorted out. this is a parameter for prediction. i meant this one.Predicted_Position = session.run(pred, feed_dict={eye_left: batch_val_data[0], \ eye_right: batch_val_data[1], face: batch_val_data[2], \ face_mask: batch_val_data[3], y: batch_val_data[4]})
you actually pointing toward a parameter, instead of exact answer, suitable for newbies (like me :P)
I think @sathiez also searched for the same answer.
from eye-tracker.
@bryanhpchiang Thank you. the problem got solved. actually tf can call layer by name and here in the code no name was used for any layer so default names were there which i extracted from the system via the code below
with tf.Session() as sess: val_ops = load_model(sess, 'pretrained_models/itracker_adv/model-23') tvars = tf.trainable_variables() tvars_vals = sess.run(tvars) f = open('file.txt', 'w') for var, val in zip(tvars, tvars_vals): f.write(var.name) f.write(str(val)) f.close()
then i got all the internal operations and then using the operation names i used the code below
lyr = tf.get_default_graph().get_tensor_by_name('operation name here e.g. Conv2D:0') lyr_output = sess.run(lyr,feed_dict={eye_left: left eye image from the loaded numpy validation data})
hence found the required images of the required layer
from eye-tracker.
I am a newbie. I am trying to launch it by this command:
python itracker_adv.py -i example.npz -lm pretrained_models/itracker_adv/model-23
Below is Error Message, what's wrong?
Traceback (most recent call last):
File "itracker_adv.py", line 468, in
main()
File "itracker_adv.py", line 465, in main
test(args)
File "itracker_adv.py", line 432, in test
_, val_data = load_data(args.input)
File "itracker_adv.py", line 72, in load_data
train_eye_left = npzfile["train_eye_left"]
File "C:\Users\ivan\Anaconda3\envs\face_rec\lib\site-packages\numpy\lib\npyio.py", line 262, in getitem
raise KeyError("%s is not a file in the archive" % key)
KeyError: 'train_eye_left is not a file in the archive'
from eye-tracker.
I am a newbie. I am trying to launch it by this command:
python itracker_adv.py -i example.npz -lm pretrained_models/itracker_adv/model-23Below is Error Message, what's wrong?
Traceback (most recent call last):
File "itracker_adv.py", line 468, in
main()
File "itracker_adv.py", line 465, in main
test(args)
File "itracker_adv.py", line 432, in test
_, val_data = load_data(args.input)
File "itracker_adv.py", line 72, in load_data
train_eye_left = npzfile["train_eye_left"]
File "C:\Users\ivan\Anaconda3\envs\face_rec\lib\site-packages\numpy\lib\npyio.py", line 262, in getitem
raise KeyError("%s is not a file in the archive" % key)
KeyError: 'train_eye_left is not a file in the archive'
I solved it. I confuse with the input data. I downloaded the dataset and retry:
python itracker_adv.py -i eye_tracker_train_and_val.npz -lm pretrained_models/itracker_adv/model-23
from eye-tracker.
@hugochan @bryanhpchiang I need little more help. can you please let me know how to manipulate weights of a trained model? I mean I have a trained model xyz-123 along with xyz-123.meta and checkpoint file. i wan to change the weights of layer-1/kernel#03 set to zero. dont know how to do that? any help please
from eye-tracker.
@hugochan @bryanhpchiang I need little more help. can you please let me know how to manipulate weights of a trained model? I mean I have a trained model xyz-123 along with xyz-123.meta and checkpoint file. i wan to change the weights of layer-1/kernel#03 set to zero. dont know how to do that? any help please
@Safiullahmarwat This is a generic question on TensorFlow. I personally don't have experience on this. Just googled a bit and found this post which you might find helpful.
from eye-tracker.
Thank you, that helped alot.
Although I solved the issue yesterday, and I was to post my solution over here :) but this post gave me some more detailed directions. Thank you :P
from eye-tracker.
hi @hugochan @bryanhpchiang once again help needed.
Is it possible to create other models (more than one instances) of the class? for example
def train(args):
train_data, val_data = load_data(args.input)
# train_size = 10
# train_data = [each[:train_size] for each in train_data]
# val_size = 1
# val_data = [each[:val_size] for each in val_data]
train_data = prepare_data(train_data)
val_data = prepare_data(val_data)
with tf.variable_scope("A", reuse=True) as scope:
et = EyeTracker()
train_loss_history, train_err_history, val_loss_history, val_err_history = et.train(train_data, val_data, \
lr=args.learning_rate, \
batch_size=args.batch_size, \
max_epoch=args.max_epoch, \
min_delta=1e-4, \
patience=args.patience, \
print_per_epoch=args.print_per_epoch,
out_model=args.save_model)
save some parts of the (et)
scope.reuse_variables()
et = EyeTracker()
Assign some parts of previous (et) to the new one and continue training
train_loss_history, train_err_history, val_loss_history, val_err_history = et.train(train_data, val_data, \
lr=args.learning_rate, \
batch_size=args.batch_size, \
max_epoch=args.max_epoch, \
min_delta=1e-4, \
patience=args.patience, \
print_per_epoch=args.print_per_epoch,
out_model=args.save_model)
currently I am getting this error
"reuse=tf.AUTO_REUSE in VarScope?" % name)
ValueError: Variable conv1_eye_w does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope?
from eye-tracker.
hi @hugochan @bryanhpchiang once again help needed.
Is it possible to create other models (more than one instances) of the class? for exampledef train(args): train_data, val_data = load_data(args.input) # train_size = 10 # train_data = [each[:train_size] for each in train_data] # val_size = 1 # val_data = [each[:val_size] for each in val_data] train_data = prepare_data(train_data) val_data = prepare_data(val_data) with tf.variable_scope("A", reuse=True) as scope: et = EyeTracker() train_loss_history, train_err_history, val_loss_history, val_err_history = et.train(train_data, val_data, \ lr=args.learning_rate, \ batch_size=args.batch_size, \ max_epoch=args.max_epoch, \ min_delta=1e-4, \ patience=args.patience, \ print_per_epoch=args.print_per_epoch, out_model=args.save_model) save some parts of the (et) scope.reuse_variables() et = EyeTracker() Assign some parts of previous (et) to the new one and continue training train_loss_history, train_err_history, val_loss_history, val_err_history = et.train(train_data, val_data, \ lr=args.learning_rate, \ batch_size=args.batch_size, \ max_epoch=args.max_epoch, \ min_delta=1e-4, \ patience=args.patience, \ print_per_epoch=args.print_per_epoch, out_model=args.save_model)
currently I am getting this error
"reuse=tf.AUTO_REUSE in VarScope?" % name)
ValueError: Variable conv1_eye_w does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope?
Could you explain what is the motivation for this?
from eye-tracker.
Hmmm. working on regularization technique. like alternative to Dropout. even if you know how to resize a variable like asked here , that will be much appreciated.
from eye-tracker.
ok partially resolved. I changed the default constructor init to a member function initilaize() and passing variables, as shown below.
g = tf.Graph()
with g.as_default():
et = EyeTracker()
et.initialize(96,256,384,64,96,256,384,64) #(conv1_eye_out, conv2_eye_out, conv3_eye_out, conv4_eye_out, conv1_face_out, conv2_face_out, conv3_face_out, conv4_face_out)
result_temp = et.train(n_epoch, train_data, val_data, lr=args.learning_rate, batch_size=args.batch_size, max_epoch=args.max_epoch, min_delta=1e-4, patience=args.patience, print_per_epoch=args.print_per_epoch, out_model=args.save_model)
g = tf.Graph()
with g.as_default():
et = EyeTracker()
et.initialize(80,256,384,64,96,256,384,64) #(conv1_eye_out, conv2_eye_out, conv3_eye_out, conv4_eye_out, conv1_face_out, conv2_face_out, conv3_face_out, conv4_face_out)
result_temp = et.train(n_epoch, train_data, val_data, lr=args.learning_rate, batch_size=args.batch_size, max_epoch=args.max_epoch, min_delta=1e-4, patience=args.patience, print_per_epoch=args.print_per_epoch, out_model=args.save_model)
But I am still waiting for the tensor resize command, if any body knows how to resize a tensor, that would be great.
from eye-tracker.
Related Issues (20)
- Thanks for the wonderful code for eye tracking and detection,and I want to know how to prepare own dataset into the *.npz file, HOT 1
- 请教下数据集合中y的含义? HOT 3
- python code to extract face, left eye, right eye and face grid from multiple images HOT 1
- Prediction of itracker_nets HOT 1
- 关于标签y HOT 2
- What is train_y and val_y in dataset? HOT 6
- 你好,请问facemask在预测的时候传入的是什么格式的?比如其它特征是64x64的矩阵格式。多谢博主 HOT 6
- How i can train the dataset HOT 1
- What is the tensorflow version required for this Eye-Tracker HOT 3
- I have a question regarding input_data HOT 1
- Dropout in Eye-Tracker
- Link for smaller dataset
- enquiry of nature of smaller data set
- 如何使用gazecapture数据集进行训练 HOT 1
- about http://hugochan.net/download/eye_tracker_train_and_val.npz HOT 2
- Training on Custom Dataset HOT 4
- about the better prediction error HOT 4
- Hi,hugochan! Thanks for your excellent work, I am a green hand of DL, There for I am asking for your help, could you share your preproccessing codes with me?Because I want to process the original data to the format just like your smaller dataset is, but I have no idea with it. Thank in advance! HOT 1
- how to use? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eye-tracker.