Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev' of github.com:idealo/image-quality-assessment into…
Browse files Browse the repository at this point in the history
… dev
  • Loading branch information
clennan committed Oct 17, 2019
2 parents 3cf94db + f0eacc8 commit 003f8e2
Show file tree
Hide file tree
Showing 48 changed files with 1,302 additions and 21 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ Image quality assessment is compatible with Python 3.6 and is distributed under
## Trained models
| <sub>Predictions from aesthetic model</sub>
| :--:
| ![](/_readme/images_aesthetic/aesthetic1.jpg_aesthetic.svg)
| ![](readme_figures/images_aesthetic/aesthetic1.jpg_aesthetic.svg)


| <sub>Predictions from technical model</sub>
| :--:
| ![](/_readme/images_technical/techncial3.jpgtechnical.svg)
| ![](readme_figures/images_technical/techncial3.jpgtechnical.svg)



Expand Down Expand Up @@ -164,6 +164,7 @@ See the [Contribution](CONTRIBUTING.md) guide for more details.

## Datasets
This project uses two datasets to train the NIMA model:

1. [**AVA**](https://github.com/ylogx/aesthetics/tree/master/data/ava) used for aesthetic ratings ([data](http://academictorrents.com/details/71631f83b11d3d79d8f84efe0a7e12f0ac001460))
2. [**TID2013**](http://www.ponomarenko.info/tid2013.htm) used for technical ratings

Expand Down
6 changes: 3 additions & 3 deletions contrib/tf_serving/save_tfs_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import keras.backend as K
import tensorflow.keras.backend as K
import argparse
from keras.applications.mobilenet import DepthwiseConv2D, relu6
from keras.utils.generic_utils import CustomObjectScope
from tensorflow.keras.applications.mobilenet import DepthwiseConv2D, relu6
from tensorflow.keras.utils.generic_utils import CustomObjectScope
from tensorflow.python.saved_model import builder as saved_model_builder
from tensorflow.python.saved_model import tag_constants
from tensorflow.python.saved_model.signature_def_utils_impl import \
Expand Down
2 changes: 1 addition & 1 deletion contrib/tf_serving/tfs_sample_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
import argparse
import keras
import tensorflow.keras as keras
import numpy as np
import tensorflow as tf
from src.utils import utils
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/build_docs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

cp ../README.md docs/index.md
cp -r ../_readme docs/_readme
cp -r ../_readme_figures docs/
cp ../CONTRIBUTING.md docs/CONTRIBUTING.md
cp ../LICENSE docs/LICENSE.md
python autogen.py
Expand Down
4 changes: 4 additions & 0 deletions mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ theme:
repo_name: 'idealo/image-quality-assessment'
repo_url: 'https://github.com/idealo/image-quality-assessment'

google_analytics:
- 'UA-137434942-3'
- 'auto'

markdown_extensions:
- codehilite
2 changes: 1 addition & 1 deletion mkdocs/run_docs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

cp ../README.md docs/index.md
cp -r ../_readme docs/_readme
cp -r ../readme_figures docs/
cp ../CONTRIBUTING.md docs/CONTRIBUTING.md
cp ../LICENSE docs/LICENSE.md
python autogen.py
Expand Down
Binary file added readme_figures/images_aesthetic/aesthetic1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
452 changes: 452 additions & 0 deletions readme_figures/images_aesthetic/aesthetic1.jpg_aesthetic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme_figures/images_aesthetic/aesthetic2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme_figures/images_aesthetic/aesthetic3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme_figures/images_aesthetic/aesthetic4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme_figures/images_aesthetic/aesthetic5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme_figures/images_aesthetic/aesthetic6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme_figures/images_technical/techncial2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme_figures/images_technical/techncial3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
449 changes: 449 additions & 0 deletions readme_figures/images_technical/techncial3.jpgtechnical.svg

Large diffs are not rendered by default.

Binary file added readme_figures/images_technical/technical1.jpg
Binary file added readme_figures/images_technical/technical4.bmp
Binary file not shown.
Binary file added readme_figures/images_technical/technical5.bmp
Binary file not shown.
Binary file added readme_figures/images_technical/technical6.bmp
Binary file not shown.
375 changes: 375 additions & 0 deletions readme_figures/images_technical/technical6.bmp_aesthetic.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/handlers/data_generator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import os
import numpy as np
import keras
import tensorflow.keras as keras
from utils import utils


Expand Down
12 changes: 6 additions & 6 deletions src/handlers/model_builder.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import importlib
from keras.models import Model
from keras.layers import Dropout, Dense
from keras.optimizers import Adam
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dropout, Dense
from tensorflow.keras.optimizers import Adam
from utils.losses import earth_movers_distance


Expand All @@ -21,11 +21,11 @@ def __init__(self, base_model_name, n_classes=10, learning_rate=0.001, dropout_r
def _get_base_module(self):
# import Keras base model module
if self.base_model_name == 'InceptionV3':
self.base_module = importlib.import_module('keras.applications.inception_v3')
self.base_module = importlib.import_module('tensorflow.keras.applications.inception_v3')
elif self.base_model_name == 'InceptionResNetV2':
self.base_module = importlib.import_module('keras.applications.inception_resnet_v2')
self.base_module = importlib.import_module('tensorflow.keras.applications.inception_resnet_v2')
else:
self.base_module = importlib.import_module('keras.applications.'+self.base_model_name.lower())
self.base_module = importlib.import_module('tensorflow.keras.applications.'+self.base_model_name.lower())

def build(self):
# get base model class
Expand Down
4 changes: 2 additions & 2 deletions src/trainer/train.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import os
import argparse
from keras import backend as K
from keras.callbacks import ModelCheckpoint
from tensorflow.keras import backend as K
from tensorflow.keras.callbacks import ModelCheckpoint
from sklearn.model_selection import train_test_split
from handlers.data_generator import TrainDataGenerator, TestDataGenerator
from handlers.model_builder import Nima
Expand Down
4 changes: 2 additions & 2 deletions src/utils/keras_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import keras.backend as K
from keras.callbacks import TensorBoard
import tensorflow.keras.backend as K
from tensorflow.keras.callbacks import TensorBoard


class TensorBoardBatch(TensorBoard):
Expand Down
2 changes: 1 addition & 1 deletion src/utils/losses.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from keras import backend as K
from tensorflow.keras import backend as K


def earth_movers_distance(y_true, y_pred):
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import os
import json
import keras
import tensorflow.keras as keras
import numpy as np


Expand Down

0 comments on commit 003f8e2

Please sign in to comment.