Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Cittena
cittena
Commits
e6b6d417
Commit
e6b6d417
authored
Aug 18, 2019
by
Niels-Oliver Walkowski
Browse files
refac(mod): Adapt contant names to PEP8
parent
bd495ef3
Changes
1
Hide whitespace changes
Inline
Side-by-side
itten/corpus.py
View file @
e6b6d417
...
...
@@ -3,7 +3,7 @@ from cv2 import imread, imwrite
import
numpy
as
np
from
.movie
import
Movie
SUMMARY
=
{
'seqmean'
:
{
'monochromatic'
:
[
'luminance'
],
_summary
=
{
'seqmean'
:
{
'monochromatic'
:
[
'luminance'
],
'saturation'
:
[
'saturation'
,
'colourfulness'
],
'hue'
:
[
'hsV'
,
'labHcl'
]},
'distribution'
:
{
'monochromatic'
:
[
'luminance'
],
...
...
@@ -20,7 +20,7 @@ class Corpus(object):
"""
def
__init__
(
self
,
path
=
'./'
,
summary
=
False
):
self
.
basedir
=
Path
(
path
)
self
.
summary
=
summary
if
summary
else
SUMMARY
self
.
summary
=
summary
if
summary
else
_summary
self
.
status
=
self
.
_report
()
# Aktualisieren nach jeder Digitalisier.
self
.
movies
=
self
.
_instantiate_movies
()
...
...
@@ -106,17 +106,17 @@ class Corpus(object):
tasks
=
{}
for
m
in
self
.
status
.
keys
():
print
(
m
)
for
view
in
SUMMARY
.
keys
():
for
view
in
_summary
.
keys
():
print
(
view
)
print
(
self
.
status
[
m
].
keys
())
if
view
not
in
self
.
status
[
m
][
'data'
].
keys
():
tasks
[
view
]
=
SUMMARY
[
view
]
tasks
[
view
]
=
_summary
[
view
]
else
:
for
contrast
in
SUMMARY
[
view
].
keys
():
for
contrast
in
_summary
[
view
].
keys
():
if
contrast
not
in
self
.
status
[
m
][
'data'
][
view
].
keys
():
tasks
.
setdefault
(
view
,
{})[
contrast
]
=
(
SUMMARY
[
view
][
contrast
])
tasks
.
setdefault
(
view
,
{})[
contrast
]
=
(
_summary
[
view
][
contrast
])
else
:
for
method
in
SUMMARY
[
view
][
contrast
]:
for
method
in
_summary
[
view
][
contrast
]:
if
method
not
in
self
.
status
[
m
][
'data'
][
view
][
contrast
].
keys
():
tasks
.
setdefault
(
view
,
{}).
setdefault
(
contrast
,
[]).
append
(
method
)
print
(
tasks
)
...
...
@@ -151,12 +151,19 @@ class Corpus(object):
Returns:
numpy.ndarray -- A numpy ndarry with the data type uint8
showing the tableau as an image.
Todo:
FEATURE Allow to create tableaus for all diagrams available for a
specific movie
FIXME Move tableau methods to the visuals module
"""
components
=
self
.
_filter_diagrams
(
shape
=
shape
,
ctrst
=
ctrst
,
meth
=
meth
)
layout
=
self
.
layout_tableau
(
len
(
components
))
tableau
=
self
.
_fit_components
(
components
,
layout
)
if
write
:
imwrite
(
'tableau.png'
,
tableau
)
file_name
=
self
.
basedir
/
(
shape
+
'_'
+
ctrst
+
'_'
+
meth
+
'.png'
)
imwrite
(
str
(
file_name
),
tableau
)
return
tableau
def
_filter_diagrams
(
self
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment