Skip to content

Commit d50d165

Browse files
committed
v0.1.4
1 parent 40e1399 commit d50d165

File tree

5 files changed

+12
-56
lines changed

5 files changed

+12
-56
lines changed

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,20 @@ Example:
5858

5959
handshape_datasets.delete_temporary_files("dataset_id") --> Delete the local files if its exist a .npz file
6060

61-
## How to use the dataset in keras?
61+
## Training a handshape classifier with Keras
6262

63-
First, you must to load the dataset
63+
64+
65+
Load the dataset:
6466

6567
dataset = handshape_datasets.load(dataset_id, version=ver, delete=supr)
6668

67-
You could have the input_shape and the number of classes
69+
Get the input_shape and number of classes:
6870

6971
input_shape = self.dataset[0][0].shape
7072
classes = self.dataset[1]['y'].max() + 1
7173

72-
Then you must to build a model
74+
Define a model (using a pretrained MobileNet here):
7375

7476
base_model = keras.applications.mobilenet.MobileNet(input_shape=(input_shape[0],self.input_shape[1],3),
7577
weights='imagenet', include_top=False)
@@ -79,17 +81,14 @@ Then you must to build a model
7981
model = Model(inputs=base_model.input, outputs=output)
8082
model.compile(optimizer='Adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
8183

82-
Its optional to split the dataset for the validation data when fit the model
84+
Split the dataset intro train/test sets:
8385

8486
X_train, X_test, Y_train, Y_test = sklearn.model_selection.train_test_split(self.dataset[0], self.dataset[1]['y'],
8587
test_size=test_size,
8688
stratify=self.dataset[1]['y'])
8789

88-
At last you must to fit the model
89-
90-
history = model.fit(X_train, Y_train, batch_size=self.batch_size, epochs=self.epochs,
91-
validation_data=(X_test, Y_test))
90+
Fit the model
9291

93-
## How to use Handshape-datasets with Google Colab:
92+
history = model.fit(X_train, Y_train, batch_size=self.batch_size, epochs=self.epochs, validation_data=(X_test, Y_test))
9493

95-
https://colab.research.google.com/drive/1kY-YrbegGFVT7NqVaeA4RjXYRVlZiISR?usp=sharing
94+
[Full example](https://colab.research.google.com/drive/1kY-YrbegGFVT7NqVaeA4RjXYRVlZiISR?usp=sharing)
File renamed without changes.

requirements_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
twine

requirements_old.txt

Lines changed: 0 additions & 44 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
long_description = DESCRIPTION
2828

2929
# Load the package's __version__.py module as a dictionary.
30-
VERSION = "0.1.3"
30+
VERSION = "0.1.4"
3131

3232

3333
class UploadCommand(Command):

0 commit comments

Comments
 (0)