Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.db.mnist
Commits
154b3929
Commit
154b3929
authored
Jul 11, 2016
by
Tiago de Freitas Pereira
Browse files
Added a download option for the bob_dbmanage. Issue
#2
parent
c3a136f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/db/mnist/driver.py
View file @
154b3929
...
...
@@ -24,6 +24,16 @@ import os
import
sys
from
bob.db.base.driver
import
Interface
as
BaseInterface
def
download_mnist
(
self
):
# Hack that will download the mnist database
import
pkg_resources
import
bob.db.mnist
db_folder
=
pkg_resources
.
resource_filename
(
__name__
,
''
)
# Defining a folder for download
db
=
bob
.
db
.
mnist
.
Database
(
data_dir
=
db_folder
)
# Downloading
del
db
class
Interface
(
BaseInterface
):
def
name
(
self
):
...
...
@@ -42,4 +52,10 @@ class Interface(BaseInterface):
def
add_commands
(
self
,
parser
):
from
.
import
__doc__
as
docs
from
bob.db.base.driver
import
download_command
subparsers
=
self
.
setup_parser
(
parser
,
"MNIST database"
,
docs
)
parser
=
download_command
(
subparsers
)
parser
.
set_defaults
(
func
=
download_mnist
)
Write
Preview
Supports
Markdown
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