DEArt: Dataset of European Art
Paper
β’
2211.01226
β’
Published
This model uses the Matterport Mask R-CNN implementation fine-tuned for detecting iconographic and symbolic elements in religious artworks. It is developed as part of the Saint George on a Bike project to enable semantic enrichment and understanding of historical imagery.
NUM_CLASSES: 69+1 (background)DETECTION_MIN_CONFIDENCE: 0.76The model detects over 40 iconographic concepts including:
crucifixionangelcrown of thornsmonkswordchalicedovelion, shepherd, scroll, key of heaven, mitre, and moreFull class list is available in the source notebook.
from mrcnn.config import Config
from mrcnn.model import MaskRCNN
from mrcnn.model import mold_image
from keras.preprocessing.image import load_img, img_to_array
from numpy import expand_dims
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
# Define class labels (shortened list)
classids=["BG","crucifixion","angel","person","crown of thorns", "horse", "dragon","bird","dog","boat","cat","book",
"sheep","shepherd","elephant","zebra","crown","tiara","camauro","zucchetto","mitre","saturno","skull",
"orange","apple","banana","nude","monk","lance","key of heaven", "banner","chalice","palm","sword","rooster",
"knight","scroll","lily","horn","prayer","tree","arrow","crozier","deer","devil","dove","eagle","hands",
"head","lion","serpent","stole","trumpet","judith","halo","helmet","shield","jug","holy shroud","god the father",
"swan", "butterfly", "bear", "centaur","pegasus","donkey","mouse","monkey","cow","unicorn"]
# Define the inference config
class PredictionConfig(Config):
NAME = "PREDICTION_cfg"
NUM_CLASSES = len(classids)
GPU_COUNT = 1
IMAGES_PER_GPU = 1
DETECTION_MIN_CONFIDENCE = 0.76
# Initialize model
cfg = PredictionConfig()
model = MaskRCNN(mode='inference', model_dir='./', config=cfg)
model.load_weights('<weights of model>', by_name=True)
# Load and process image
img = load_img("example.jpg")
image = img_to_array(img)
scaled_image = mold_image(image, cfg)
sample = expand_dims(scaled_image, 0)
# Run detection
yhat = model.detect(sample, verbose=0)[0]
# Visualize detections
fig = plt.figure(figsize=(12, 12))
ax = fig.add_subplot(111)
ax.imshow(img)
for i in range(len(yhat['rois'])):
y1, x1, y2, x2 = yhat['rois'][i]
width, height = x2 - x1, y2 - y1
rect = Rectangle((x1, y1), width, height, fill=False, color='red')
ax.add_patch(rect)
ax.text(x1 + 5, y1 + 10, classids[yhat['class_ids'][i]], fontsize=12, color='white')
plt.show()
If you use this model, please cite:
@misc{reshetnikov2022deartdataseteuropeanart,
title={DEArt: Dataset of European Art},
author={Artem Reshetnikov and Maria-Cristina Marinescu and Joaquim More Lopez},
year={2022},
eprint={2211.01226},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2211.01226},
}
This research has been supported by the Saint George on a Bike project 2018-EU-IA-0104, co-financed by the Connecting Europe Facility of the European Union.
Base model
blesot/Mask-RCNN