Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Python SDK v1.6.0 #170

Merged
merged 6 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/engine-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8]
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
os: [macos-latest, windows-latest]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set the env variables
run: |
echo "USE_HARD_LINKS=false" >> $GITHUB_ENV
Expand Down Expand Up @@ -41,9 +41,9 @@ jobs:
fi
id: extract_executable_name

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: "3.10"

- name: Install Engine dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ confidence=
# --disable=W"
# TODO: remove R1710 (inconsistent-return-statements)
# TODO: remove C0111 (missing-docstring)
disable=similarities,fixme,I0011,E1102,R1710,C0111
disable=similarities,fixme,I0011,E1102,R1710,C0111,cyclic-import

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
12 changes: 6 additions & 6 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ verify_ssl = true

[packages]
apscheduler = "==3.7.0"
datature = "==1.0.1"
datature = "==1.6.0"
dirhash = "==0.2.1"
flask = "==2.0.0"
flask-cors = "==3.0.10"
Expand All @@ -16,13 +16,13 @@ numpy = "==1.21.6"
onnx = "==1.12.0"
onnx2torch = "==1.5.6"
onnxruntime = "==1.14.1"
opencv-python = "==4.6.0.66"
pillow = "==8.2.0"
opencv-python = "==4.7.0.72"
pillow = "==9.5.0"
scandir = "==1.10.0"
scantree = "==0.0.1"
shapely = "==2.0.1"
tensorflow = "==2.10.0"
tensorflow-macos = {version = "==2.10.0", sys_platform = "== 'darwin'", platform_machine = "== 'arm64'"}
tensorflow = "==2.11.0"
tensorflow-macos = {version = "==2.11.0", sys_platform = "== 'darwin'", platform_machine = "== 'arm64'"}
torch = "==1.12.1"
torchvision = "==0.13.1"
ultralytics = "==8.0.133"
Expand All @@ -33,4 +33,4 @@ isort = "*"
pylint = "*"

[requires]
python_version = "3.7"
python_version = "3.9"
2,050 changes: 1,001 additions & 1,049 deletions Pipfile.lock

Large diffs are not rendered by default.

Empty file modified build-windows.sh
100644 → 100755
Empty file.
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"devDependencies": {
"electron": "^13.1.2",
"electron-builder": "^23.0.2",
"electron-builder": "^23.6.0",
"npx": "^10.2.2"
},
"optionalDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
APScheduler==3.7.0
datature==1.0.1
datature==1.6.0
dirhash==0.2.1
Flask==2.0.0
Flask-Cors==3.0.10
Flask-RESTful==0.3.9
Flask-SocketIO==5.1.0
jsonpickle==2.0.0
numpy==1.21.6
opencv-python==4.6.0.66
Pillow==8.2.0
opencv-python==4.7.0.72
Pillow==9.5.0
scandir==1.10.0
scantree==0.0.1
shapely==2.0.1
tensorflow==2.10.0; sys_platform != 'darwin' or platform_machine != 'arm64'
tensorflow-macos==2.10.0; sys_platform == 'darwin' and platform_machine == 'arm64'
tensorflow==2.11.0; sys_platform != 'darwin' or platform_machine != 'arm64'
tensorflow-macos==2.11.0; sys_platform == 'darwin' and platform_machine == 'arm64'
torch==1.12.1
torchvision==0.13.1
onnx==1.12.0
Expand Down
2 changes: 1 addition & 1 deletion setup-virtualenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ else
python3 -m pip install --upgrade pip
python3 -m pip install pipenv
fi
PIPENV_VENV_IN_PROJECT=1 PIPENV_DEFAULT_PYTHON_VERSION=3.7 pipenv sync -d
PIPENV_VENV_IN_PROJECT=1 PIPENV_DEFAULT_PYTHON_VERSION=3.9 pipenv sync -d

cd ..

Expand Down
2 changes: 2 additions & 0 deletions src/app/src/api/annotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export function APIRegisterModel(
description: string,
directory: string,
modelKey: string,
projectKey: string,
projectSecret: string,
modelURL: string
): Promise<AxiosResponse<any>> {
Expand All @@ -146,6 +147,7 @@ export function APIRegisterModel(
description,
credentials: {
modelKey,
projectKey,
projectSecret,
modelURL,
},
Expand Down
18 changes: 16 additions & 2 deletions src/app/src/components/annotations/model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export type FormData = {
description: string;
directory: string;
modelKey: string;
projectKey: string;
projectSecret: string;
modelURL: string;
modelType: "tensorflow" | "darknet" | "autodetect" | "";
Expand Down Expand Up @@ -131,6 +132,7 @@ export default class Model extends React.Component<ModelProps, ModelState> {
description: "",
directory: "",
modelKey: "",
projectKey: "",
projectSecret: "",
modelURL: "",
},
Expand Down Expand Up @@ -234,6 +236,7 @@ export default class Model extends React.Component<ModelProps, ModelState> {
this.state.formData.description,
this.state.formData.directory,
this.state.formData.modelKey,
this.state.formData.projectKey,
this.state.formData.projectSecret,
this.state.formData.modelURL
)
Expand Down Expand Up @@ -552,7 +555,16 @@ export default class Model extends React.Component<ModelProps, ModelState> {
id="modelKey"
name="modelKey"
value={this.state.formData.modelKey}
placeholder="Enter model key from hub..."
placeholder="Enter model key from Nexus..."
onChange={this.handleChangeForm}
/>
</FormGroup>
<FormGroup label="Project Key" labelFor="label-input">
<InputGroup
id="projectKey"
name="projectKey"
value={this.state.formData.projectKey}
placeholder="Enter project key from Nexus..."
onChange={this.handleChangeForm}
/>
</FormGroup>
Expand All @@ -561,7 +573,7 @@ export default class Model extends React.Component<ModelProps, ModelState> {
id="projectSecret"
name="projectSecret"
value={this.state.formData.projectSecret}
placeholder="Enter project secret from hub..."
placeholder="Enter project secret from Nexus..."
onChange={this.handleChangeForm}
/>{" "}
</FormGroup>
Expand Down Expand Up @@ -673,6 +685,7 @@ export default class Model extends React.Component<ModelProps, ModelState> {
description: "",
directory: "",
modelKey: "",
projectKey: "",
projectSecret: "",
modelURL: "",
},
Expand Down Expand Up @@ -1066,6 +1079,7 @@ export default class Model extends React.Component<ModelProps, ModelState> {
description: "",
directory: "",
modelKey: "",
projectKey: "",
projectSecret: "",
modelURL: "",
},
Expand Down
6 changes: 4 additions & 2 deletions src/engine/server/models/endpoint_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class EndpointModel(BaseModel):

def _load_label_map_(self):
"""Overloaded from Parent Class."""
link = self.kwargs["link"] + "/classes"
index = self.kwargs["link"].rfind("/predict")
link = self.kwargs["link"][:index] + "/classes"
project_secret = self.kwargs["project_secret"]
headers = {"Authorization": "Bearer " + project_secret}
response = requests.get(
Expand Down Expand Up @@ -81,7 +82,7 @@ def predict(self, image_array):
"data": encodebytes(bts.tostring()).decode("ascii"),
"image_type": "base_64",
}
link = self.kwargs["link"] + "/predict"
link = self.kwargs["link"]
project_secret = self.kwargs["project_secret"]
headers = {"Authorization": "Bearer " + project_secret}
response = requests.post(
Expand All @@ -90,6 +91,7 @@ def predict(self, image_array):
headers=headers,
)
output = response.json()

# convert output into the tensor required by the BaseModel predict
boxes = []
classes = []
Expand Down
Loading
Loading