Keras-OpenFace icon indicating copy to clipboard operation
Keras-OpenFace copied to clipboard

Generator

Open swed397 opened this issue 5 years ago • 0 comments

Hello, could you tell me where i can find triplet_generator()? from data import triplet_generator

triplet_generator() creates a generator that continuously returns

([a_batch, p_batch, n_batch], None) tuples where a_batch, p_batch

and n_batch are batches of anchor, positive and negative RGB images

each having a shape of (batch_size, 96, 96, 3).

generator = triplet_generator()

nn4_small2_train.compile(loss=None, optimizer='adam') nn4_small2_train.fit_generator(generator, epochs=10, steps_per_epoch=100)

Please note that the current implementation of the generator only generates

random image data. The main goal of this code snippet is to demonstrate

the general setup for model training. In the following, we will anyway

use a pre-trained model so we don't need a generator here that operates

on real training data. I'll maybe provide a fully functional generator

later.

swed397 avatar Oct 14 '19 08:10 swed397