Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Grégor JOUET
Leaderboard
Commits
eb04a909
Commit
eb04a909
authored
Jan 13, 2021
by
Grégor JOUET
🔧
Browse files
improved
parent
c6741056
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
1 deletion
+26
-1
.dockerignore
.dockerignore
+1
-0
Dockerfile
Dockerfile
+5
-0
app.py
app.py
+14
-1
requirements.txt
requirements.txt
+6
-0
No files found.
.dockerignore
0 → 100644
View file @
eb04a909
dataset/
Dockerfile
View file @
eb04a909
FROM
python:3
WORKDIR
/app
ADD
. .
RUN
pip3
install
-r
requirements.txt
CMD
python3 app.py
\ No newline at end of file
app.py
View file @
eb04a909
...
...
@@ -37,7 +37,6 @@ class Record():
score_unscaled
:
float
=
0.
score
:
float
=
0.
def
update_score_unscaled
(
self
,
min_max
:
dict
):
def
scale
(
elem
,
min
,
max
):
if
max
-
min
==
0
:
...
...
@@ -152,6 +151,10 @@ class API:
log
.
success
(
"Starting server"
)
self
.
app
.
run
(
host
=
"0.0.0.0"
,
port
=
8080
)
def
reset_leaderboard
(
self
):
with
self
.
lock
:
self
.
leaderboard
=
[]
# Thread Target
def
compute_models
(
self
):
log
.
fine
(
'Preparing cifar10'
)
...
...
@@ -189,6 +192,12 @@ class API:
with
self
.
lock
:
if
filename
in
self
.
processing_list
:
del
self
.
processing_list
[
filename
]
# Delete previous record
for
e
in
self
.
leaderboard
:
if
e
.
name
==
new_elem
.
name
and
e
.
surname
==
new_elem
.
surname
:
self
.
leaderboard
.
remove
(
e
)
break
self
.
leaderboard
.
append
(
new_elem
)
self
.
update_min_max
()
...
...
@@ -218,6 +227,10 @@ def allowed_file(filename):
log
.
fine
(
f
'Checking
{
filename
}
'
)
return
not
(
m
==
None
or
m
.
span
()[
1
]
!=
len
(
filename
))
@
app
.
route
(
'/reset'
)
def
reset_leaderboard
():
api
.
reset_leaderboard
()
@
app
.
route
(
'/submit'
,
methods
=
[
'POST'
])
def
submit
():
"""
...
...
requirements.txt
View file @
eb04a909
torch
torchvision
numpy
flask
tqdm
splogger
\ No newline at end of file
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