-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
97 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,44 @@ | ||
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | ||
from __future__ import absolute_import | ||
|
||
import copy | ||
from pkg_resources import iter_entry_points | ||
|
||
from . import imageGradients | ||
from . import objectDetection | ||
|
||
data_extensions = [ | ||
# Set show=True if extension should be shown by default | ||
# on DIGITS home page. These defaults can be changed by | ||
# editing DIGITS config option 'data_extension_list' | ||
{'class': imageGradients.DataIngestion, 'show': False}, | ||
{'class': objectDetection.DataIngestion, 'show': True}, | ||
|
||
# Entry point group (this is the key we use to register and | ||
# find installed plug-ins) | ||
GROUP = "digits.plugins.data" | ||
|
||
|
||
# built-in extensions | ||
builtin_data_extensions = [ | ||
imageGradients.DataIngestion, | ||
objectDetection.DataIngestion, | ||
] | ||
|
||
|
||
def get_extensions(show_all=False): | ||
""" | ||
return set of data data extensions | ||
""" | ||
return [extension['class'] | ||
for extension in data_extensions | ||
if show_all or extension['show']] | ||
extensions = copy.copy(builtin_data_extensions) | ||
# find installed extension plug-ins | ||
for entry_point in iter_entry_points(group=GROUP, name=None): | ||
extensions.append(entry_point.load()) | ||
|
||
return [extension | ||
for extension in extensions | ||
if show_all or extension.get_default_visibility()] | ||
|
||
|
||
def get_extension(extension_id): | ||
""" | ||
return extension associated with specified extension_id | ||
""" | ||
for extension in data_extensions: | ||
extension_class = extension['class'] | ||
if extension_class.get_id() == extension_id: | ||
return extension_class | ||
for extension in get_extensions(show_all=True): | ||
if extension.get_id() == extension_id: | ||
return extension | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from setuptools import setup, find_packages | ||
|
||
import digits | ||
|
||
setup( | ||
name = "digits", | ||
packages = find_packages(), | ||
version = digits.__version__ | ||
) |