Giter VIP home page Giter VIP logo

Comments (13)

david-di avatar david-di commented on July 19, 2024 4

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.

jimmy3456 avatar jimmy3456 commented on July 19, 2024

hi, David
Thank you, it works for me

from insightface_tf.

WJSAI avatar WJSAI commented on July 19, 2024

@jimmy3456 Hello, I have encountered the same problem. Can you tell me how to solve it? thank you very much.

from insightface_tf.

jimmy3456 avatar jimmy3456 commented on July 19, 2024

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.

WJSAI avatar WJSAI commented on July 19, 2024

@jimmy3456
hi, jimmy3456
Thank you, it works for me

from insightface_tf.

muneebullahkhan avatar muneebullahkhan commented on July 19, 2024

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
errorr

from insightface_tf.

david-di avatar david-di commented on July 19, 2024

@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.

SunnyWangGitHub avatar SunnyWangGitHub commented on July 19, 2024

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:
image

can you tell me that how i fix it? Any help will be grateful! thanks!

from insightface_tf.

muneebullahkhan avatar muneebullahkhan commented on July 19, 2024

Thanks david-di my error is slove

from insightface_tf.

Crisfw avatar Crisfw commented on July 19, 2024

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.

Crisfw avatar Crisfw commented on July 19, 2024

@jimmy3456

from insightface_tf.

TengliEd avatar TengliEd commented on July 19, 2024

Hi @david-di the error below occurred.
屏幕快照 2019-04-04 下午5 30 45
Here is the code:
屏幕快照 2019-04-04 下午5 32 51

from insightface_tf.

zfs1993 avatar zfs1993 commented on July 19, 2024

Hi @david-di the error below occurred.
屏幕快照 2019-04-04 下午5 30 45
Here is the code:
屏幕快照 2019-04-04 下午5 32 51

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)

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.