omoindrot / tensorflow-triplet-loss

Implementation of triplet loss in TensorFlow
https://omoindrot.github.io/triplet-loss
MIT License
1.12k stars 283 forks source link

For market data #8

Closed mahfujau closed 5 years ago

mahfujau commented 6 years ago

Can you release the code for market1501 dataset, please?

omoindrot commented 6 years ago

You mean adapt the code for MNIST to make it work with the market1501 dataset?

I would encourage you to do it yourself and maybe submit a pull request?

bzhong2 commented 6 years ago

Is there any example of importing custom dataset?

omoindrot commented 6 years ago

If you want to use your own dataset, you just need to create an input function that returns a dataset containing (image, label) pairs, just like in model/input_fn.py.

You can check a tutorial on creating TensorFlow Datasets here: https://www.tensorflow.org/programmers_guide/datasets

cxfire16 commented 6 years ago

Hi @omoindrot, to what I've understood the model/input_fn.py just seems to feed data into the model which makes me think that it's the mnist_dataset.py that we should create to be able to adapt other datasets. Am I understanding it correctly? btw, thanks for pointing out the guide to creating input pipelines! huge help! thanks!

omoindrot commented 6 years ago

@cxfire16: As long as you create a tf.data.Dataset (as described in the dataset guide) and return it in the input function you should be good.

You should also look at the estimator guide to understand more about the input functions you need.

The mnist_dataset.py file is taken from the official TensorFlow repo (here) and downloads the TFRecords files for MNIST and create a dataset.

You don't need to go through TFRecords to work on your own dataset, you can just build a simple input function with tf.data and use it in the estimator.

cxfire16 commented 6 years ago

That's noted! Thanks!