Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build my model on my own data set #33

Open
ProjectsRebository opened this issue Jan 22, 2019 · 3 comments
Open

build my model on my own data set #33

ProjectsRebository opened this issue Jan 22, 2019 · 3 comments

Comments

@ProjectsRebository
Copy link

ProjectsRebository commented Jan 22, 2019

i read the post and understand that the network will be for feature extraction (is this right ?)
i want to make model on my own data set

when i read the blog post i understand that the steps to generate my network is
1- prepare my data set using tensor flow
for example i will use below code to prepare data set

import cv2

# Use a custom OpenCV function to read the image, instead of the standard
# TensorFlow `tf.read_file()` operation.
def _read_py_function(filename, label):
  image_decoded = cv2.imread(filename.decode(), cv2.IMREAD_GRAYSCALE)
  return image_decoded, label

# Use standard TensorFlow operations to resize the image to a fixed shape.
def _resize_function(image_decoded, label):
  image_decoded.set_shape([None, None, None])
  image_resized = tf.image.resize_images(image_decoded, [28, 28])
  return image_resized, label

filenames = ["/var/data/image1.jpg", "/var/data/image2.jpg", ...]
labels = [0, 37, 29, 1, ...]

dataset = tf.data.Dataset.from_tensor_slices((filenames, labels))
dataset = dataset.map(
    lambda filename, label: tuple(tf.py_func(
        _read_py_function, [filename, label], [tf.uint8, label.dtype])))
dataset = dataset.map(_resize_function) 

2- then i will pass this data set to train.py as arg
but what i can't understand is params file (i don't know what is the values inside it )
and also will the code generate model for me ?and after that i can send image to that model and the model will recognize it

i am bit confused can you help me to understand and make model on my own data set
thanks in advance
i appreciate your help

@omoindrot
Copy link
Owner

The parameters file contains all the hyper parameters of the model (ex: learning rate, number of layers...).

Maybe you should learn more about the basics of machine learning first, by following classes like these:

@Tushn
Copy link

Tushn commented Jan 29, 2019

I'm newbie in Keras (I was using Caffe and DLIB), I'm searching a way for reuse your tripletloss with other network.

But, "estimator" resource of Keras is new for me, and I cant see or reuse your layers like "model" objects to allow. For example, I can't use "model.summary()" for to print layers.

May you help me, with any tip?

@omoindrot
Copy link
Owner

You can use your own model, but just the triplet loss I defined.

See #18 for a discussion on how to use the loss with Keras.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants