All Projects → GKalliatakis → Keras Vgg16 Places365

GKalliatakis / Keras Vgg16 Places365

Licence: mit
Keras code and weights files for the VGG16-places365 and VGG16-hybrid1365 CNNs for scene classification

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Keras Vgg16 Places365

Video Classification 2 Stream Cnn
Video Classification using 2 stream CNN
Stars: ✭ 305 (+121.01%)
Mutual labels:  cnn, vgg16
Srgan
Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
Stars: ✭ 2,641 (+1813.77%)
Mutual labels:  cnn, vgg16
Deep Learning With Python
Deep learning codes and projects using Python
Stars: ✭ 195 (+41.3%)
Mutual labels:  cnn, vgg16
Neural Image Captioning
Implementation of Neural Image Captioning model using Keras with Theano backend
Stars: ✭ 12 (-91.3%)
Mutual labels:  cnn, vgg16
Multi Class Text Classification Cnn Rnn
Classify Kaggle San Francisco Crime Description into 39 classes. Build the model with CNN, RNN (GRU and LSTM) and Word Embeddings on Tensorflow.
Stars: ✭ 570 (+313.04%)
Mutual labels:  cnn, embeddings
Multi Class Text Classification Cnn
Classify Kaggle Consumer Finance Complaints into 11 classes. Build the model with CNN (Convolutional Neural Network) and Word Embeddings on Tensorflow.
Stars: ✭ 410 (+197.1%)
Mutual labels:  cnn, embeddings
Magnetloss Pytorch
PyTorch implementation of a deep metric learning technique called "Magnet Loss" from Facebook AI Research (FAIR) in ICLR 2016.
Stars: ✭ 217 (+57.25%)
Mutual labels:  cnn, embeddings
Food Recipe Cnn
food image to recipe with deep convolutional neural networks.
Stars: ✭ 448 (+224.64%)
Mutual labels:  cnn, vgg16
Eda nlp
Data augmentation for NLP, presented at EMNLP 2019
Stars: ✭ 902 (+553.62%)
Mutual labels:  cnn, embeddings
Deeplearning Nlp Models
A small, interpretable codebase containing the re-implementation of a few "deep" NLP models in PyTorch. Colab notebooks to run with GPUs. Models: word2vec, CNNs, transformer, gpt.
Stars: ✭ 64 (-53.62%)
Mutual labels:  cnn, embeddings
Pytorch convlstm
convolutional lstm implementation in pytorch
Stars: ✭ 126 (-8.7%)
Mutual labels:  cnn
Asr syllable
基于卷积神经网络的语音识别声学模型的研究
Stars: ✭ 127 (-7.97%)
Mutual labels:  cnn
Mk Tfjs
Play MK.js with TensorFlow.js
Stars: ✭ 133 (-3.62%)
Mutual labels:  cnn
Adnet
Attention-guided CNN for image denoising(Neural Networks,2020)
Stars: ✭ 135 (-2.17%)
Mutual labels:  cnn
Motionblur Detection By Cnn
Stars: ✭ 126 (-8.7%)
Mutual labels:  cnn
Gtzan.keras
[REPO] Music Genre classification on GTZAN dataset using CNNs
Stars: ✭ 132 (-4.35%)
Mutual labels:  cnn
Hash Embeddings
PyTorch implementation of Hash Embeddings (NIPS 2017). Submission to the NIPS Implementation Challenge.
Stars: ✭ 126 (-8.7%)
Mutual labels:  embeddings
Deeplearning Notes
Notes for Deep Learning Specialization Courses led by Andrew Ng.
Stars: ✭ 126 (-8.7%)
Mutual labels:  cnn
Libfacedetection
An open source library for face detection in images. The face detection speed can reach 1000FPS.
Stars: ✭ 10,852 (+7763.77%)
Mutual labels:  cnn
Vpilot
Scripts and tools to easily communicate with DeepGTAV. In the future a self-driving agent will be implemented.
Stars: ✭ 136 (-1.45%)
Mutual labels:  cnn

Keras | VGG16 Places365 - VGG16 CNN models pre-trained on Places365-Standard for scene classification

Keras logo

license Tweet

You have just found the Keras models of the pre-trained VGG16 CNNs on Places365-Standard (~1.8 million images from 365 scene categories).

Overview

CNNs trained on Places365 database (latest subset of Places2 Database) could be directly used for scene recognition, while the deep scene features from the higher level layer of CNN could be used as generic features for visual recognition.

Paper

The Keras models has been obtained by directly converting the Caffe models provived by the authors (all the original Caffe-based resources can be found there).

More details about the architecture of the networks can be found in the following paper:

Places: A 10 million Image Database for Scene Recognition
Zhou, B., Lapedriza, A., Khosla, A., Oliva, A., & Torralba, A.
IEEE Transactions on Pattern Analysis and Machine Intelligence

Please consider citing the above paper if you use the pre-trained CNN models.

Contents:

This repository contains code for the following Keras models:

  • VGG16-places365
  • VGG16-hybrid1365

Usage:

All architectures are compatible with both TensorFlow and Theano, and upon instantiation the models will be built according to the image dimension ordering set in your Keras configuration file at ~/.keras/keras.json. For instance, if you have set image_dim_ordering=tf, then any model loaded from this repository will get built according to the TensorFlow dimension ordering convention, "Width-Height-Depth".

Pre-trained weights can be automatically loaded upon instantiation (weights='places' argument in model constructor for all image models). Weights are automatically downloaded.

Examples

Classify Places classes with VGG16-places365

import os
import urllib2
import numpy as np
from PIL import Image
from cv2 import resize

from vgg16_places_365 import VGG16_Places365

TEST_IMAGE_URL = 'http://places2.csail.mit.edu/imgs/demo/6.jpg'

image = Image.open(urllib2.urlopen(TEST_IMAGE_URL))
image = np.array(image, dtype=np.uint8)
image = resize(image, (224, 224))
image = np.expand_dims(image, 0)

model = VGG16_Places365(weights='places')
predictions_to_return = 5
preds = model.predict(image)[0]
top_preds = np.argsort(preds)[::-1][0:predictions_to_return]

# load the class label
file_name = 'categories_places365.txt'
if not os.access(file_name, os.W_OK):
    synset_url = 'https://raw.githubusercontent.com/csailvision/places365/master/categories_places365.txt'
    os.system('wget ' + synset_url)
classes = list()
with open(file_name) as class_file:
    for line in class_file:
        classes.append(line.strip().split(' ')[0][3:])
classes = tuple(classes)

print('--SCENE CATEGORIES:')
# output the prediction
for i in range(0, 5):
    print(classes[top_preds[i]])

# --PREDICTED SCENE CATEGORIES:
# cafeteria
# food_court
# restaurant_patio
# banquet_hall
# restaurant


Extract features from images with VGG16-hybrid1365

import urllib2
import numpy as np
from PIL import Image
from cv2 import resize

from vgg16_hybrid_places_1365 import VGG16_Hybrid_1365

TEST_IMAGE_URL = 'http://places2.csail.mit.edu/imgs/demo/6.jpg'

image = Image.open(urllib2.urlopen(TEST_IMAGE_URL))
image = np.array(image, dtype=np.uint8)
image = resize(image, (224, 224))
image = np.expand_dims(image, 0)

model = VGG16_Hybrid_1365(weights='places', include_top=False)
features = model.predict(image)

References

Additionally, don't forget to cite this repo if you use these models:

@misc{gkallia2017keras_places365,
title={Keras-VGG16-Places365},
author={Grigorios Kalliatakis},
year={2017},
publisher={GitHub},
howpublished={\url{https://github.com/GKalliatakis/Keras-VGG16-places365}},
}

Licensing

We are always interested in how these models are being used, so if you found them useful or plan to make a release of code based on or using this package, it would be great to hear from you.

Where to get other trained models?

More info on downloading, converting, and submitting other models can be found on the main Keras | Application Zoo repository.

Questions and Comments

If you have any suggestions or bugs to report you can pull a request or start a discussion.


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].