Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aminehorseman/mobilenet-v2-custom-dataset
Using Keras MobileNet-v2 model with your custom images dataset
https://github.com/aminehorseman/mobilenet-v2-custom-dataset
computer-vision custom-data custom-dataset deep-learning deep-neural-networks digits-recognition image-classification keras keras-models keras-tensorflow machine-learning python python-3 tensorflow tensorflow-models
Last synced: 2 months ago
JSON representation
Using Keras MobileNet-v2 model with your custom images dataset
- Host: GitHub
- URL: https://github.com/aminehorseman/mobilenet-v2-custom-dataset
- Owner: amineHorseman
- License: gpl-3.0
- Created: 2018-10-02T22:08:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-21T13:37:37.000Z (almost 6 years ago)
- Last Synced: 2023-03-08T16:32:10.265Z (almost 2 years ago)
- Topics: computer-vision, custom-data, custom-dataset, deep-learning, deep-neural-networks, digits-recognition, image-classification, keras, keras-models, keras-tensorflow, machine-learning, python, python-3, tensorflow, tensorflow-models
- Language: Python
- Size: 20.5 KB
- Stars: 5
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mobilenet-v2-custom-dataset
Using Keras MobileNet-v2 model with your custom images datasetThe Keras implementation of MobileNet-v2 (from Keras-Application package) uses by default famous datasets such as imagenet, cifar in a encoded format. But what if we want to use our own custom dataset?
The problem is that if we load all images in a single numpy array, the memory will quickly overload, that's why in this repository we use keras `ImageDataGenerator` class to generate batches during the runtime. The advantage of using `ImageDataGenerator` to generate batches instream of making a hand-made loop over our dataset is that it is directly supported by keras models and we just have to call `fit_generator` method to train on the batches. Moreover, we can easily activate the data augmentation option.
Our custom dataset need to have the following structure: for every class create a folder containing .jpg sample images:
```
dataset_folder\
class1\
image1.jpg
image2.jpg
class2\
image1.jpg
image2.jpg
image3.jpg
```## How to use?
1. Configure the parameters in config.json
2. Train the model using `python train.py`
3. Evaluate the model on test dataset using: `python test.py`