Comments (13)
Read the function named mx2tfrecords at ./data/mx2tfrecords/, and 'main' part in the same file shows its invoking process. You need to download the origin dataset (see: https://github.com/deepinsight/insightface), then try to use function mx2tfrecords to convert train.rec and train.idx to tran.tfrecords.
from insightface_tf.
hi, David
Thank you, it works for me
from insightface_tf.
@jimmy3456 Hello, I have encountered the same problem. Can you tell me how to solve it? thank you very much.
from insightface_tf.
hi WJSAI
As David said, you have to download the origin dataset first then modify the main part of "mx2tfrecords.py" at ./data/mx2tfrecords/
Here is my modify part at mx2tfrecords.py :
if name == 'main':
# # define parameters
id2range = {}
data_shape = (3, 112, 112)
args = parse_args()
imgrec = mx.recordio.MXIndexedRecordIO(args.idx_path, args.bin_path, 'r')
s = imgrec.read_idx(0)
header, _ = mx.recordio.unpack(s)
print(header.label)
imgidx = list(range(1, int(header.label[0])))
seq_identity = range(int(header.label[0]), int(header.label[1]))
for identity in seq_identity:
s = imgrec.read_idx(identity)
header, _ = mx.recordio.unpack(s)
a, b = int(header.label[0]), int(header.label[1])
id2range[identity] = (a, b)
print('id2range', len(id2range))
# # generate tfrecords
mx2tfrecords(imgidx, imgrec, args)
#config = tf.ConfigProto(allow_soft_placement=True)
#sess = tf.Session(config=config)
# training datasets api config
#tfrecords_f = os.path.join(args.tfrecords_file_path, 'tran.tfrecords')
#dataset = tf.data.TFRecordDataset(tfrecords_f)
#dataset = dataset.map(parse_function)
#dataset = dataset.shuffle(buffer_size=30000)
#dataset = dataset.batch(32)
#iterator = dataset.make_initializable_iterator()
#next_element = iterator.get_next()
# begin iteration
#for i in range(1000):
# sess.run(iterator.initializer)
# while True:
# try:
# images, labels = sess.run(next_element)
# cv2.imshow('test', images[1, ...])
# cv2.waitKey(0)
# except tf.errors.OutOfRangeError:
# print("End of dataset")
hope this would help you
from insightface_tf.
@jimmy3456
hi, jimmy3456
Thank you, it works for me
from insightface_tf.
Hi David
when i run the following code
import tensorflow as tf
image=tf.image.decode_jpeg(tf.read_file("images/test.jpg"))
sess=tf.Session()
print(sess.run(image))
then this error show
please tell me that how i fix it
from insightface_tf.
@muneebullahkhan
I guess you are using ipython. Maybe you need to check whether the path 'image/test.jpg' is consistent with your workdir. At least, I don't think there is any mistake in your code.
from insightface_tf.
Hi @david-di
when i try to use function mx2tfrecords to convert train.rec and train.idx to tran.tfrecords like jimmy @jimmy3456
then this error show:
can you tell me that how i fix it? Any help will be grateful! thanks!
from insightface_tf.
Thanks david-di my error is slove
from insightface_tf.
Thanks for the advice. And could you tell me more details about the “modifiy" . Is the code in the top modified and is the code in the down commented? Or simply give the complete code. Thanks a lot.
from insightface_tf.
from insightface_tf.
Hi @david-di the error below occurred.
Here is the code:
from insightface_tf.
Hi @david-di the error below occurred.
Here is the code:
i find head.label is a 1*2 array ,so i take the first number as the label(i guess,) ,then the error will disappear ,but when i run train_nets.py it will stuck at Shuffle buffer filled
from insightface_tf.
Related Issues (20)
- About the accuracy computation(关于计算准确率的问题) HOT 1
- the number of samples is not 5.8M
- resnet_v1_50/block1/unit_1/bottleneck_v1/shortcut_bn/BatchNorm/beta
- stom
- could I get the 512-D face embedding features ?
- pre trained models HOT 2
- How can I directly test the LFW data set with an existing model to get accuracy?Which folder is the model in?
- Embeddings model d
- In what format does the labels should be
- How to download pretrain ?
- Thank you for your code,could you tell why I feed input with shape(n,112,112,3),but just get the embedding with shape(1,512) HOT 1
- Performance issues in your project (by P3) HOT 1
- Performance issues in train_nets.py(P2)
- from models import base_server NOT IMPORTING
- center parallel strategy
- any instruction how to start?
- Share model please,,..
- Did you try a lighter base such as MobileFaceNet?
- compared with facenet HOT 2
- How to solve the problem of "summary" errors during training?
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 insightface_tf.