Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.db.mnist
Commits
5f9cd1f2
Commit
5f9cd1f2
authored
Jul 11, 2016
by
Tiago de Freitas Pereira
Committed by
GitHub
Jul 11, 2016
Browse files
Merge pull request
#5
from tiagofrepereira2012/master
Added a download option for the bob_dbmanage.py script. Issue
#2
parents
c3a136f8
154b3929
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/db/mnist/driver.py
View file @
5f9cd1f2
...
...
@@ -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
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