Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
navipy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olivier Bertrand
navipy
Commits
8abef62d
Commit
8abef62d
authored
7 years ago
by
Luise Odenthal
Browse files
Options
Downloads
Patches
Plain Diff
stuff from todo list
parent
31d2f3cf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
navipy/database/__init__.py
+8
-5
8 additions, 5 deletions
navipy/database/__init__.py
with
8 additions
and
5 deletions
navipy/database/__init__.py
+
8
−
5
View file @
8abef62d
...
@@ -149,8 +149,9 @@ It creates three sql table on initialisation.
...
@@ -149,8 +149,9 @@ It creates three sql table on initialisation.
self
.
db_cursor
=
self
.
db
.
cursor
()
self
.
db_cursor
=
self
.
db
.
cursor
()
for
tablename
,
_
in
self
.
tablecolumns
.
items
():
for
tablename
,
_
in
self
.
tablecolumns
.
items
():
if
not
self
.
table_exist
(
tablename
):
if
not
self
.
table_exist
(
tablename
):
raise
Exception
(
'
{} does not contain a table named {}
'
.
format
(
raise
Exception
(
'
{} does not contain
\
filename
,
tablename
))
a table named {}
'
.
format
(
filename
,
tablename
))
elif
self
.
create
():
elif
self
.
create
():
# Create database
# Create database
self
.
db
=
sqlite3
.
connect
(
self
.
db
=
sqlite3
.
connect
(
...
@@ -365,8 +366,9 @@ database
...
@@ -365,8 +366,9 @@ database
if
not
len
(
image
.
shape
)
==
3
:
if
not
len
(
image
.
shape
)
==
3
:
raise
Exception
(
'
image should be 3D array
'
)
raise
Exception
(
'
image should be 3D array
'
)
if
not
image
.
shape
[
2
]
==
len
(
self
.
channels
):
if
not
image
.
shape
[
2
]
==
len
(
self
.
channels
):
raise
Exception
(
'
image does not have the required number of channels {}
'
.
format
(
raise
Exception
(
'
image does not have the
\
len
(
self
.
channels
)))
required number of channels {}
'
.
format
(
len
(
self
.
channels
)))
if
not
isinstance
(
cmaxminrange
,
pd
.
Series
):
if
not
isinstance
(
cmaxminrange
,
pd
.
Series
):
raise
TypeError
(
'
cmaxminrange should be a pandas Series
'
)
raise
TypeError
(
'
cmaxminrange should be a pandas Series
'
)
denormed_im
=
np
.
zeros
(
image
.
shape
,
dtype
=
np
.
float
)
denormed_im
=
np
.
zeros
(
image
.
shape
,
dtype
=
np
.
float
)
...
@@ -382,7 +384,8 @@ database
...
@@ -382,7 +384,8 @@ database
cimage
+=
cmin
cimage
+=
cmin
denormed_im
[:,
:,
chan_i
]
=
cimage
denormed_im
[:,
:,
chan_i
]
=
cimage
if
not
np
.
max
(
cimage
)
==
cmax
:
if
not
np
.
max
(
cimage
)
==
cmax
:
raise
Exception
(
'
denormalisation failed {}!={}
'
.
format
(
np
.
max
(
cimage
),
cmax
))
raise
Exception
(
'
denormalisation failed
\
{}!={}
'
.
format
(
np
.
max
(
cimage
),
cmax
))
return
denormed_im
return
denormed_im
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment