In [2]:
%load_ext autoreload
%autoreload 2
from IPython.display import HTML
import vislab.datasets
import vislab._results
import os


The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload

In [3]:
def top_k_images(df, k=10):
    return HTML(' '.join('<img src="{}" width="210px" />'.format(x) for x in df['image_url'].iloc[:k]))

Flickr and PASCAL on Flickr


In [63]:
# Flickr predictions, ground truth, and split info is all here.

results_df, preds_panel = aphrodite.results.load_pred_results(
    'flickr_oct26', os.path.expanduser('~/work/aphrodite/data/results2'),
    multiclass=False, force=False)

mc_pred_df = preds_panel.minor_xs('fusion_flickr_oct26 None vw')


Loaded from cache: 7 records
Out[63]:
<class 'pandas.core.frame.DataFrame'>
Index: 50198 entries, f_1094854525 to f_99137295
Data columns (total 37 columns):
importance                          50198  non-null values
label                               50198  non-null values
pred_style_Bright,_Energetic        50198  non-null values
pred_style_Depth_of_Field           50198  non-null values
pred_style_Ethereal                 50198  non-null values
pred_style_Geometric_Composition    50198  non-null values
pred_style_HDR                      50198  non-null values
pred_style_Hazy                     50198  non-null values
pred_style_Horror                   50198  non-null values
pred_style_Long_Exposure            50198  non-null values
pred_style_Macro                    50198  non-null values
pred_style_Melancholy               50198  non-null values
pred_style_Minimal                  50198  non-null values
pred_style_Noir                     50198  non-null values
pred_style_Romantic                 50198  non-null values
pred_style_Serene                   50198  non-null values
pred_style_Soft,_Pastel             50198  non-null values
pred_style_Sunny                    50198  non-null values
pred_style_Vintage                  50198  non-null values
split                               50198  non-null values
style_Bright,_Energetic             50198  non-null values
style_Depth_of_Field                50198  non-null values
style_Ethereal                      50198  non-null values
style_Geometric_Composition         50198  non-null values
style_HDR                           50198  non-null values
style_Hazy                          50198  non-null values
style_Horror                        50198  non-null values
style_Long_Exposure                 50198  non-null values
style_Macro                         50198  non-null values
style_Melancholy                    50198  non-null values
style_Minimal                       50198  non-null values
style_Noir                          50198  non-null values
style_Romantic                      50198  non-null values
style_Serene                        50198  non-null values
style_Soft,_Pastel                  50198  non-null values
style_Sunny                         50198  non-null values
style_Vintage                       50198  non-null values
dtypes: object(37)

In [64]:
# PASCAL predictions

results_df, preds_panel = aphrodite.results.load_pred_results(
    'pascal_on_flickr_oct29', os.path.expanduser('~/work/aphrodite/data/results2'),
    multiclass=False, force=False)

content_pred_df = preds_panel.minor_xs('decaf_fc6 False vw')
content_pred_df.columns = [x.replace('clf flickr_', '') for x in content_pred_df.columns]
content_pred_df = content_pred_df.astype(float)


Loaded from cache: 10 records

In [73]:
mc_pred_df = mc_pred_df.join(content_pred_df)
mc_pred_df['image_url'] = flickr_df['image_url']
flickr_df = mc_pred_df

In [74]:
# top cats
top_k_images(flickr_df.sort('class_cat', ascending=False))


Out[74]:

In [75]:
# ground truth bright, sorted by cat
top_k_images(flickr_df[flickr_df['style_Bright,_Energetic']].sort('class_cat', ascending=False))


Out[75]:

In [86]:
# cats sorted by bright
top_k_images(flickr_df.sort('class_cat', ascending=False).iloc[:1000].sort('pred_style_Bright,_Energetic', ascending=False))


Out[86]:

In [59]:
top_k_images(flickr_df[flickr_df['style_HDR']].sort('class_cat', ascending=False))


Out[59]:

In [46]:
top_k_images(flickr_df[flickr_df['style_Romantic']].sort('class_cat', ascending=False))


Out[46]:

In [47]:
top_k_images(flickr_df[flickr_df['style_Vintage']].sort('class_cat', ascending=False))


Out[47]:

In [48]:
top_k_images(flickr_df[flickr_df['style_Horror']].sort('class_cat', ascending=False))


Out[48]:

In [56]:
top_k_images(flickr_df[flickr_df['style_Melancholy']].sort('class_cat', ascending=False))


Out[56]:

PASCAL on Wikipaintings


In [18]:
results_df, preds_panel = vislab._results.load_pred_results(
    'pascal_mc_on_wikipaintings_mar23', os.path.expanduser('~/work/aphrodite/data/results'),
    multiclass=True, force=False)

content_pred_df = preds_panel.minor_xs('caffe_fc7 False vw')


Loaded from cache: 1 records

In [19]:
label_df = vislab.datasets.wikipaintings.get_style_df()
df = content_pred_df.join(label_df)

In [21]:
top_k_images(df[df['style_Impressionism']].sort('pred_metaclass_animal', ascending=False))


Out[21]:

In [22]:
top_k_images(df[df['style_Impressionism']].sort('pred_metaclass_indoor', ascending=False))


Out[22]:

In [23]:
top_k_images(df[df['style_Impressionism']].sort('pred_metaclass_vehicle', ascending=False))


Out[23]:

In [24]:
top_k_images(df[df['style_Impressionism']].sort('pred_metaclass_person', ascending=False))


Out[24]: