Skip to content

Commit a92ebed

Browse files
Add diffgram model base class and example
1 parent e9a4f51 commit a92ebed

File tree

10 files changed

+156
-2
lines changed

10 files changed

+156
-2
lines changed

sdk/diffgram.egg-info/PKG-INFO

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
Metadata-Version: 2.1
2+
Name: diffgram
3+
Version: 0.0.0
4+
Summary: SDK for Diffgram
5+
Home-page: https://github.com/diffgram/python-sdk
6+
Author: Diffgram
7+
Author-email: support@diffgram.com
8+
Classifier: Programming Language :: Python :: 3
9+
Classifier: License :: OSI Approved :: MIT License
10+
Classifier: Operating System :: OS Independent
11+
Description-Content-Type: text/markdown
12+
13+
14+
# SDK for Diffgram
15+
16+
This is the SDK for [Diffgram](https://github.com/diffgram/diffgram) <br> and
17+
[Diffgram.com](https://diffgram.com/) <br>
18+
19+
## SDK Install
20+
21+
#### [Full Documentation](https://diffgram.readme.io/docs)
22+
23+
### Quickstart Install SDK
24+
`pip install diffgram`
25+
26+
On linux
27+
`pip3 install diffgram`
28+
29+
[Credentials Guide](https://diffgram.readme.io/reference) <br>
30+
[Get Credentials from Diffgram.com](https://diffgram.com/) (or your Private Deploy)
31+
32+
The starting point for most useful work is to get a project:
33+
```
34+
from diffgram import Project
35+
36+
project = Project(host = "https://diffgram.com",
37+
project_string_id = "replace_with_project_string",
38+
client_id = "replace_with_client_id",
39+
client_secret = "replace_with_client_secret")
40+
```
41+
42+
Replace `host` with your URL for Open Core installs.
43+
44+
* [Tasks Introduction](https://diffgram.readme.io/docs/tasks-introduction)
45+
* [Import Introduction](https://diffgram.readme.io/docs/importing-your-data)
46+
* [Updating Existing Instances](https://diffgram.readme.io/docs/importing-instances-walkthrough)
47+
* [Pre-Label Example Video](https://youtu.be/55Hofp1H7yM)
48+
* [Compatibility](https://diffgram.readme.io/docs/compatibility-will-diffgram-work-with-my-system)
49+
50+
51+
#### Beta
52+
Note the API/SDK is in beta and is undergoing rapid improvement. There may be breaking changes.
53+
Please see the [API docs](https://diffgram.readme.io/reference) for the latest canonical reference
54+
and be sure to upgrade to latest ie: `pip install diffgram --upgrade`. We will attempt to keep the SDK up to date with the API.
55+
56+
[Help articles for Diffgram.com](https://diffgram.readme.io/) See below for some examples.
57+
58+
Requires Python >=3.5
59+
60+
The default install through pip will install dependencies
61+
for local prediction (tensorflow opencv) as listed in `requirements.txt`.
62+
The only requirement needed for majority of functions is `requests`.
63+
If you are looking for a minimal size install and already have requests use
64+
the `--no-dependencies` flag ie `pip install diffgram --no-dependencies`
65+

sdk/diffgram.egg-info/SOURCES.txt

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
setup.py
2+
diffgram/__init__.py
3+
diffgram.egg-info/PKG-INFO
4+
diffgram.egg-info/SOURCES.txt
5+
diffgram.egg-info/dependency_links.txt
6+
diffgram.egg-info/requires.txt
7+
diffgram.egg-info/top_level.txt
8+
diffgram/brain/__init__.py
9+
diffgram/brain/brain.py
10+
diffgram/brain/inference.py
11+
diffgram/brain/instance.py
12+
diffgram/brain/train.py
13+
diffgram/convert/__init__.py
14+
diffgram/convert/convert.py
15+
diffgram/core/__init__.py
16+
diffgram/core/core.py
17+
diffgram/core/diffgram_dataset_iterator.py
18+
diffgram/core/directory.py
19+
diffgram/core/directory_samples.py
20+
diffgram/core/sliced_directory.py
21+
diffgram/export/__init__.py
22+
diffgram/export/export.py
23+
diffgram/file/__init__.py
24+
diffgram/file/file.py
25+
diffgram/file/file_3d.py
26+
diffgram/file/file_constructor.py
27+
diffgram/file/test_existing_instances.py
28+
diffgram/file/test_file.py
29+
diffgram/file/view.py
30+
diffgram/job/__init__.py
31+
diffgram/job/guide.py
32+
diffgram/job/job.py
33+
diffgram/label/__init__.py
34+
diffgram/label/label_new.py
35+
diffgram/label/test_label.py
36+
diffgram/member/__init__.py
37+
diffgram/models/__init__.py
38+
diffgram/models/base_model.py
39+
diffgram/pytorch_diffgram/__init__.py
40+
diffgram/pytorch_diffgram/diffgram_pytorch_dataset.py
41+
diffgram/regular/__init__.py
42+
diffgram/regular/regular.py
43+
diffgram/role/Role.py
44+
diffgram/role/__init__.py
45+
diffgram/task/__init__.py
46+
diffgram/task/task.py
47+
diffgram/task/test_task.py
48+
diffgram/tensorflow_diffgram/__init__.py
49+
diffgram/tensorflow_diffgram/diffgram_tensorflow_dataset.py
50+
diffgram/tensorflow_diffgram/pytorch_test.py
51+
diffgram/utils/__init__.py
52+
diffgram/utils/visualization_utils.py
53+
tests/__init__.py
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

sdk/diffgram.egg-info/requires.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
requests>=2.20.1
2+
scipy>=1.1.0
3+
six>=1.9.0
4+
pillow>=6.1.0
5+
imageio>=2.9.0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
diffgram
2+
tests

sdk/diffgram/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
from diffgram.core.core import Project
66
from diffgram.file.file import File
77
from diffgram.task.task import Task
8+
from diffgram.models.base_model import DiffgramBaseModel

sdk/diffgram/core/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from diffgram.task.task import Task
1919
from requests.auth import HTTPBasicAuth
2020

21-
2221
class Project():
2322
default_directory: Directory
2423
last_response_header: None

sdk/diffgram/models/__init__.py

Whitespace-only changes.

sdk/diffgram/models/base_model.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from fastapi import FastAPI
2+
3+
class DiffgramBaseModel():
4+
def init(self):
5+
pass
6+
7+
def infere(self):
8+
raise NotImplementedError
9+
10+
def get_schema(self):
11+
raise NotImplementedError
12+
13+
def ping(self):
14+
pass
15+
16+
def serve(self, app):
17+
@app.get("/infere")
18+
async def predict():
19+
return {
20+
"message": "Infere route"
21+
}
22+
23+
@app.get("/get_schema")
24+
async def schema():
25+
return {
26+
"message": "Get schema here"
27+
}

sdk/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ six>=1.9.0
55
tensorflow>=1.12.0
66
pillow
77
torch
8-
imageio>=2.9.0
8+
imageio>=2.9.0
9+
fastapi>=0.85.0

0 commit comments

Comments
 (0)