clarifai 9.3.0__tar.gz → 9.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {clarifai-9.3.0/clarifai.egg-info → clarifai-9.3.1}/PKG-INFO +1 -1
- clarifai-9.3.1/clarifai/urls/helper.py +82 -0
- {clarifai-9.3.0 → clarifai-9.3.1/clarifai.egg-info}/PKG-INFO +1 -1
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai.egg-info/SOURCES.txt +6 -1
- clarifai-9.3.1/clarifai_utils/modules/__init__.py +0 -0
- clarifai-9.3.1/clarifai_utils/modules/style.css +171 -0
- clarifai-9.3.1/clarifai_utils/urls/__init__.py +0 -0
- clarifai-9.3.1/clarifai_utils/urls/helper.py +82 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/setup.py +1 -1
- {clarifai-9.3.0 → clarifai-9.3.1}/LICENSE +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/MANIFEST.in +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/README.md +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/auth/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/auth/helper.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/client/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/client/abc.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/client/stub.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/datasets/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/datasets/base.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/datasets/features.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/datasets/image.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/datasets/text.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/datasets/zoo/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/datasets/zoo/coco_captions.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/datasets/zoo/coco_detection.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/datasets/zoo/coco_segmentation.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/examples.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/data_upload/upload.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/listing/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/listing/concepts.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/listing/datasets.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/listing/inputs.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/listing/installed_module_versions.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/listing/lister.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/listing/models.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/listing/module_versions.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/listing/modules.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/modules/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/modules/css.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai/modules/pages.py +0 -0
- {clarifai-9.3.0/clarifai_utils → clarifai-9.3.1/clarifai}/modules/style.css +0 -0
- {clarifai-9.3.0/clarifai_utils → clarifai-9.3.1/clarifai/urls}/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai.egg-info/dependency_links.txt +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai.egg-info/requires.txt +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai.egg-info/top_level.txt +0 -0
- {clarifai-9.3.0/clarifai_utils/auth → clarifai-9.3.1/clarifai_utils}/__init__.py +0 -0
- {clarifai-9.3.0/clarifai_utils/data_upload → clarifai-9.3.1/clarifai_utils/auth}/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/auth/helper.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/client/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/client/abc.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/client/stub.py +0 -0
- {clarifai-9.3.0/clarifai_utils/data_upload/datasets → clarifai-9.3.1/clarifai_utils/data_upload}/__init__.py +0 -0
- {clarifai-9.3.0/clarifai_utils/data_upload/datasets/zoo → clarifai-9.3.1/clarifai_utils/data_upload/datasets}/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/data_upload/datasets/base.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/data_upload/datasets/features.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/data_upload/datasets/image.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/data_upload/datasets/text.py +0 -0
- {clarifai-9.3.0/clarifai_utils/listing → clarifai-9.3.1/clarifai_utils/data_upload/datasets/zoo}/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/data_upload/datasets/zoo/coco_captions.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/data_upload/datasets/zoo/coco_detection.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/data_upload/datasets/zoo/coco_segmentation.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/data_upload/examples.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/data_upload/upload.py +0 -0
- {clarifai-9.3.0/clarifai_utils/modules → clarifai-9.3.1/clarifai_utils/listing}/__init__.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/listing/concepts.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/listing/datasets.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/listing/inputs.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/listing/installed_module_versions.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/listing/lister.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/listing/models.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/listing/module_versions.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/listing/modules.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/modules/css.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/modules/pages.py +0 -0
- {clarifai-9.3.0 → clarifai-9.3.1}/setup.cfg +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from urllib.parse import urlparse
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ClarifaiUrlHelper(object):
|
|
5
|
+
"""Lots of helper functionality for dealing with urls around modules."""
|
|
6
|
+
|
|
7
|
+
def __init__(self, auth, module_manager_imv_id="module_manager_install"):
|
|
8
|
+
"""
|
|
9
|
+
Args:
|
|
10
|
+
auth: a ClarifaiAuthHelper object.
|
|
11
|
+
"""
|
|
12
|
+
self._auth = auth
|
|
13
|
+
self._module_manager_imv_id = module_manager_imv_id
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def auth(self):
|
|
17
|
+
return self._auth
|
|
18
|
+
|
|
19
|
+
def module_ui_url(self, user_id, app_id, module_id, module_version_id):
|
|
20
|
+
"""This is the path to the module in community."""
|
|
21
|
+
return "%s/%s/%s/modules/%s/module_versions/%s" % (
|
|
22
|
+
self.auth.ui,
|
|
23
|
+
user_id,
|
|
24
|
+
app_id,
|
|
25
|
+
module_id,
|
|
26
|
+
module_version_id,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
def module_install_ui_url(self, dest_user_id, dest_app_id, module_url):
|
|
30
|
+
"""This is a url that allows for installation of the module from the community at 'module_url'
|
|
31
|
+
into the destination app_id of the destination user_id."""
|
|
32
|
+
return ("%s/%s/%s/installed_module_versions/%s/install?install=%s" %
|
|
33
|
+
(self.auth.ui, dest_user_id, dest_app_id, self._module_manager_imv_id, module_url))
|
|
34
|
+
|
|
35
|
+
def imv_ui_url(self, dest_user_id, dest_app_id, imv_id):
|
|
36
|
+
return ("%s/%s/%s/installed_module_versions/%s" % (self.auth.ui, dest_user_id, dest_app_id,
|
|
37
|
+
imv_id))
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def split_clarifai_url(cls, url):
|
|
41
|
+
"""
|
|
42
|
+
clarifai.com uses fully qualified urls to resources.
|
|
43
|
+
They are in the format of:
|
|
44
|
+
https://clarifai.com/{user_id}/{app_id}/{resource_type}/{resource_id}/{resource_version_type}/{resource_version_id}
|
|
45
|
+
Those last two are optional.
|
|
46
|
+
|
|
47
|
+
"""
|
|
48
|
+
url = url.replace("https://", "", 1).replace("http://", "", 1)
|
|
49
|
+
o = urlparse(url)
|
|
50
|
+
path = o.path
|
|
51
|
+
path = path.lstrip("/")
|
|
52
|
+
parts = path.split("/")
|
|
53
|
+
if len(parts) != 5 and len(parts) != 7:
|
|
54
|
+
raise ValueError(
|
|
55
|
+
"Provided url must have 4 or 6 parts after the domain name. These are: {user_id}/{app_id}/{resource_type}/{resource_id}/{resource_version_type}/{resource_version_id}"
|
|
56
|
+
)
|
|
57
|
+
user_id, app_id, resource_type, resource_id = parts[1:5]
|
|
58
|
+
if len(parts) == 7:
|
|
59
|
+
resource_version_id = parts[6]
|
|
60
|
+
else:
|
|
61
|
+
resource_version_id = None
|
|
62
|
+
return user_id, app_id, resource_type, resource_id, resource_version_id
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def split_module_ui_url(cls, install):
|
|
66
|
+
"""Takes in a path like https://clarifai.com/zeiler/app/modules/module1/module_versions/2
|
|
67
|
+
to split it apart into it's IDs.
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
user_id: the author of the module.
|
|
71
|
+
app_id: the author's app the module was created in.
|
|
72
|
+
module_id: the module ID
|
|
73
|
+
module_version_id: the version of the module.
|
|
74
|
+
"""
|
|
75
|
+
user_id, app_id, resource_type, resource_id, resource_version_id = cls.split_clarifai_url(
|
|
76
|
+
install)
|
|
77
|
+
|
|
78
|
+
if resource_type != "modules" or resource_version_id is None:
|
|
79
|
+
raise ValueError(
|
|
80
|
+
"Provided install url must have 6 parts after the domain name. These are {user_id}/{app_id}/modules/{module_id}/module_versions/{module_version_id}"
|
|
81
|
+
)
|
|
82
|
+
return user_id, app_id, resource_id, resource_version_id
|
|
@@ -37,6 +37,9 @@ clarifai/listing/modules.py
|
|
|
37
37
|
clarifai/modules/__init__.py
|
|
38
38
|
clarifai/modules/css.py
|
|
39
39
|
clarifai/modules/pages.py
|
|
40
|
+
clarifai/modules/style.css
|
|
41
|
+
clarifai/urls/__init__.py
|
|
42
|
+
clarifai/urls/helper.py
|
|
40
43
|
clarifai_utils/__init__.py
|
|
41
44
|
clarifai_utils/auth/__init__.py
|
|
42
45
|
clarifai_utils/auth/helper.py
|
|
@@ -67,4 +70,6 @@ clarifai_utils/listing/modules.py
|
|
|
67
70
|
clarifai_utils/modules/__init__.py
|
|
68
71
|
clarifai_utils/modules/css.py
|
|
69
72
|
clarifai_utils/modules/pages.py
|
|
70
|
-
clarifai_utils/modules/style.css
|
|
73
|
+
clarifai_utils/modules/style.css
|
|
74
|
+
clarifai_utils/urls/__init__.py
|
|
75
|
+
clarifai_utils/urls/helper.py
|
|
File without changes
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
body {
|
|
2
|
+
font-family: -apple-system,system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.stDataFrame {
|
|
6
|
+
font-family: -apple-system,system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.stButton>button, .stDownloadButton>button, .stButton>a {
|
|
10
|
+
color: #fff;
|
|
11
|
+
background-color: #006dff;
|
|
12
|
+
border-color: transparent;
|
|
13
|
+
font-size: 0.875rem;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
outline: 0;
|
|
16
|
+
padding: 0.625rem 1rem;
|
|
17
|
+
text-align: center;
|
|
18
|
+
border: 1px solid transparent;
|
|
19
|
+
border-radius: calc( 2.8rem / 4 );
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
position: relative;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
appearance: button;
|
|
25
|
+
text-decoration: none;
|
|
26
|
+
}
|
|
27
|
+
.stButton>a {
|
|
28
|
+
font-size: 0.925rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ourButton>a:hover,
|
|
32
|
+
.stButton>button:hover,
|
|
33
|
+
.stButton>button:focus,
|
|
34
|
+
.stButton>button:focus:not(:active),
|
|
35
|
+
.stButton>button:active,
|
|
36
|
+
.stDownloadButton>button:hover,
|
|
37
|
+
.stDownloadButton>button:focus,
|
|
38
|
+
.stDownloadButton>button:focus:not(:active),
|
|
39
|
+
.stDownloadButton>button:active
|
|
40
|
+
{
|
|
41
|
+
color: #fff;
|
|
42
|
+
border-color: transparent;
|
|
43
|
+
box-shadow: none !important;
|
|
44
|
+
background-color: #356dff;
|
|
45
|
+
text-decoration: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
.stCheckbox [role="checkbox"] {
|
|
50
|
+
border: 1px solid #D0D5DD;
|
|
51
|
+
transition: all 0.1s;
|
|
52
|
+
width: 20px;
|
|
53
|
+
height: 20px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.stCheckbox [role="checkbox"][aria-checked="true"] {
|
|
57
|
+
background-color: #F2F6FE;
|
|
58
|
+
background-size: auto;
|
|
59
|
+
background-image: url('data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%229%22%20viewBox%3D%220%200%2012%209%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.6663%201.5L4.24967%207.91667L1.33301%205%22%20stroke%3D%22%23195AFF%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.stSelectbox > div > div {
|
|
63
|
+
border-radius: 8px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
.stMultiSelect > div > div {
|
|
68
|
+
border-radius: 8px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.stTextInput > div > div {
|
|
72
|
+
border-radius: 8px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.stNumberInput > div > div:first-of-type {
|
|
76
|
+
border-radius: 8px 0 0 8px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.stNumberInput button:last-of-type {
|
|
80
|
+
color: #fff;
|
|
81
|
+
background-color: #006dff;
|
|
82
|
+
border-color: transparent;
|
|
83
|
+
border-radius: 0 7px 7px 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.stTextArea > div {
|
|
87
|
+
border-radius: 8px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.stDateInput > div > div {
|
|
91
|
+
border-radius: 8px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.stTimeInput > div > div {
|
|
95
|
+
border-radius: 8px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.stNumberInput>div {
|
|
99
|
+
color: #fff;
|
|
100
|
+
border-color: #e4e7ec;
|
|
101
|
+
border-radius: 8px 8px 8px 8px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.stNumberInput>div>div>button {
|
|
105
|
+
color: #fff;
|
|
106
|
+
background-color: #006dff;
|
|
107
|
+
border-color: transparent;
|
|
108
|
+
}
|
|
109
|
+
.stNumberInput>div>div>button:hover,
|
|
110
|
+
.stNumberInput>div>div>button:hover:enabled,
|
|
111
|
+
.stNumberInput>div>div>button:focus,
|
|
112
|
+
.stNumberInput>div>div>button:focus:enabled,
|
|
113
|
+
.stNumberInput>div>div>button:focus:not(:active),
|
|
114
|
+
.stNumberInput>div>div>button:active
|
|
115
|
+
{
|
|
116
|
+
color: #fff;
|
|
117
|
+
border-color: transparent;
|
|
118
|
+
box-shadow: none !important;
|
|
119
|
+
background-color: #356dff;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
div[data-testid="stFileUploader"]>section>button {
|
|
124
|
+
color: #fff;
|
|
125
|
+
background-color: #006dff;
|
|
126
|
+
border-color: transparent;
|
|
127
|
+
border-radius: 8px;
|
|
128
|
+
padding: 0.625rem 1rem;
|
|
129
|
+
font-weight: 600;
|
|
130
|
+
}
|
|
131
|
+
div[data-testid="stFileUploader"]>section {
|
|
132
|
+
border-radius: 8px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
div[data-testid="stFileUploader"]>section>button:hover,
|
|
136
|
+
div[data-testid="stFileUploader"]>section>button:hover:enabled,
|
|
137
|
+
div[data-testid="stFileUploader"]>section>button:focus,
|
|
138
|
+
div[data-testid="stFileUploader"]>section>button:focus:enabled,
|
|
139
|
+
div[data-testid="stFileUploader"]>section>button:focus:not(:active),
|
|
140
|
+
div[data-testid="stFileUploader"]>section>button:active
|
|
141
|
+
{
|
|
142
|
+
color: #fff;
|
|
143
|
+
border-color: transparent;
|
|
144
|
+
box-shadow: none !important;
|
|
145
|
+
background-color: #356dff;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
.stTextInput>div>div>input {
|
|
150
|
+
background-color: #fff;
|
|
151
|
+
border-radius: 9.8px;
|
|
152
|
+
border-color: transparent;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
div[data-baseweb="base-input"] {
|
|
156
|
+
color: #4F8BF9;
|
|
157
|
+
background-color: #fff;
|
|
158
|
+
border-radius: 9.8px;
|
|
159
|
+
border-color: transparent;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
footer {
|
|
164
|
+
display: none !important;
|
|
165
|
+
color: #FFF !important;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
div[data-testid="stDecoration"] {
|
|
169
|
+
display: none !important;
|
|
170
|
+
background-image: none;
|
|
171
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from urllib.parse import urlparse
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ClarifaiUrlHelper(object):
|
|
5
|
+
"""Lots of helper functionality for dealing with urls around modules."""
|
|
6
|
+
|
|
7
|
+
def __init__(self, auth, module_manager_imv_id="module_manager_install"):
|
|
8
|
+
"""
|
|
9
|
+
Args:
|
|
10
|
+
auth: a ClarifaiAuthHelper object.
|
|
11
|
+
"""
|
|
12
|
+
self._auth = auth
|
|
13
|
+
self._module_manager_imv_id = module_manager_imv_id
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def auth(self):
|
|
17
|
+
return self._auth
|
|
18
|
+
|
|
19
|
+
def module_ui_url(self, user_id, app_id, module_id, module_version_id):
|
|
20
|
+
"""This is the path to the module in community."""
|
|
21
|
+
return "%s/%s/%s/modules/%s/module_versions/%s" % (
|
|
22
|
+
self.auth.ui,
|
|
23
|
+
user_id,
|
|
24
|
+
app_id,
|
|
25
|
+
module_id,
|
|
26
|
+
module_version_id,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
def module_install_ui_url(self, dest_user_id, dest_app_id, module_url):
|
|
30
|
+
"""This is a url that allows for installation of the module from the community at 'module_url'
|
|
31
|
+
into the destination app_id of the destination user_id."""
|
|
32
|
+
return ("%s/%s/%s/installed_module_versions/%s/install?install=%s" %
|
|
33
|
+
(self.auth.ui, dest_user_id, dest_app_id, self._module_manager_imv_id, module_url))
|
|
34
|
+
|
|
35
|
+
def imv_ui_url(self, dest_user_id, dest_app_id, imv_id):
|
|
36
|
+
return ("%s/%s/%s/installed_module_versions/%s" % (self.auth.ui, dest_user_id, dest_app_id,
|
|
37
|
+
imv_id))
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def split_clarifai_url(cls, url):
|
|
41
|
+
"""
|
|
42
|
+
clarifai.com uses fully qualified urls to resources.
|
|
43
|
+
They are in the format of:
|
|
44
|
+
https://clarifai.com/{user_id}/{app_id}/{resource_type}/{resource_id}/{resource_version_type}/{resource_version_id}
|
|
45
|
+
Those last two are optional.
|
|
46
|
+
|
|
47
|
+
"""
|
|
48
|
+
url = url.replace("https://", "", 1).replace("http://", "", 1)
|
|
49
|
+
o = urlparse(url)
|
|
50
|
+
path = o.path
|
|
51
|
+
path = path.lstrip("/")
|
|
52
|
+
parts = path.split("/")
|
|
53
|
+
if len(parts) != 5 and len(parts) != 7:
|
|
54
|
+
raise ValueError(
|
|
55
|
+
"Provided url must have 4 or 6 parts after the domain name. These are: {user_id}/{app_id}/{resource_type}/{resource_id}/{resource_version_type}/{resource_version_id}"
|
|
56
|
+
)
|
|
57
|
+
user_id, app_id, resource_type, resource_id = parts[1:5]
|
|
58
|
+
if len(parts) == 7:
|
|
59
|
+
resource_version_id = parts[6]
|
|
60
|
+
else:
|
|
61
|
+
resource_version_id = None
|
|
62
|
+
return user_id, app_id, resource_type, resource_id, resource_version_id
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def split_module_ui_url(cls, install):
|
|
66
|
+
"""Takes in a path like https://clarifai.com/zeiler/app/modules/module1/module_versions/2
|
|
67
|
+
to split it apart into it's IDs.
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
user_id: the author of the module.
|
|
71
|
+
app_id: the author's app the module was created in.
|
|
72
|
+
module_id: the module ID
|
|
73
|
+
module_version_id: the version of the module.
|
|
74
|
+
"""
|
|
75
|
+
user_id, app_id, resource_type, resource_id, resource_version_id = cls.split_clarifai_url(
|
|
76
|
+
install)
|
|
77
|
+
|
|
78
|
+
if resource_type != "modules" or resource_version_id is None:
|
|
79
|
+
raise ValueError(
|
|
80
|
+
"Provided install url must have 6 parts after the domain name. These are {user_id}/{app_id}/modules/{module_id}/module_versions/{module_version_id}"
|
|
81
|
+
)
|
|
82
|
+
return user_id, app_id, resource_id, resource_version_id
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clarifai-9.3.0/clarifai_utils/data_upload → clarifai-9.3.1/clarifai_utils/auth}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clarifai-9.3.0 → clarifai-9.3.1}/clarifai_utils/data_upload/datasets/zoo/coco_segmentation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|