Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.base
Commits
23d69e51
Commit
23d69e51
authored
7 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Replace directories
parent
54a71013
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!137
Add support for listing annotator configs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/base/script/annotate.py
+10
-3
10 additions, 3 deletions
bob/bio/base/script/annotate.py
with
10 additions
and
3 deletions
bob/bio/base/script/annotate.py
+
10
−
3
View file @
23d69e51
...
...
@@ -3,7 +3,7 @@
import
logging
import
json
import
click
from
os.path
import
dirname
,
isfile
from
os.path
import
dirname
,
isfile
,
expanduser
from
bob.extension.scripts.click_helper
import
(
verbosity_option
,
ConfigCommand
,
ResourceOption
)
from
bob.io.base
import
create_directories_safe
...
...
@@ -19,9 +19,12 @@ logger = logging.getLogger(__name__)
entry_point_group
=
'
bob.bio.annotator
'
)
@click.option
(
'
--output-dir
'
,
'
-o
'
,
required
=
True
,
cls
=
ResourceOption
)
@click.option
(
'
--force
'
,
'
-f
'
,
is_flag
=
True
,
cls
=
ResourceOption
)
@click.option
(
'
--array
'
,
type
=
click
.
INT
,
default
=
1
,)
@click.option
(
'
--array
'
,
type
=
click
.
INT
,
default
=
1
,
cls
=
ResourceOption
)
@click.option
(
'
--database-directories-file
'
,
cls
=
ResourceOption
,
default
=
expanduser
(
'
~/.bob_bio_databases.txt
'
))
@verbosity_option
(
cls
=
ResourceOption
)
def
annotate
(
database
,
annotator
,
output_dir
,
force
,
array
,
**
kwargs
):
def
annotate
(
database
,
annotator
,
output_dir
,
force
,
array
,
database_directories_file
,
**
kwargs
):
"""
Annotates a database.
The annotations are written in text file (json) format which can be read
back using :any:`bob.db.base.read_annotation_file` (annotation_type=
'
json
'
)
...
...
@@ -60,8 +63,12 @@ def annotate(database, annotator, output_dir, force, array, **kwargs):
logger
.
debug
(
'
force: %s
'
,
force
)
logger
.
debug
(
'
output_dir: %s
'
,
output_dir
)
logger
.
debug
(
'
array: %s
'
,
array
)
logger
.
debug
(
'
database_directories_file: %s
'
,
database_directories_file
)
logger
.
debug
(
'
kwargs: %s
'
,
kwargs
)
# Some databases need their original_directory to be replaced
database
.
replace_directories
(
database_directories_file
)
biofiles
=
database
.
objects
(
groups
=
None
,
protocol
=
database
.
protocol
)
biofiles
=
sorted
(
biofiles
)
...
...
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