Skip to content

Commit 1965723

Browse files
committed
remove __future__ annotations import for 3.6 compatibility
1 parent db80158 commit 1965723

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/lobe/model/image_model.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Load a Lobe saved model for image classification
33
"""
4-
from __future__ import annotations
54
from PIL import Image
65

76
from .model import Model
@@ -14,7 +13,7 @@ class ImageModel(Model):
1413
signature: ImageClassificationSignature
1514

1615
@classmethod
17-
def load_from_signature(cls, signature: ImageClassificationSignature) -> ImageModel:
16+
def load_from_signature(cls, signature: ImageClassificationSignature):
1817
# Select the appropriate backend
1918
model_format = signature.format
2019
if model_format == "tf":
@@ -30,7 +29,7 @@ def load_from_signature(cls, signature: ImageClassificationSignature) -> ImageMo
3029
raise ValueError(f"Model is an unsupported format: {model_format}")
3130

3231
@classmethod
33-
def load(cls, model_path: str) -> ImageModel:
32+
def load(cls, model_path: str):
3433
# Load the signature
3534
return cls.load_from_signature(ImageClassificationSignature(model_path))
3635

src/lobe/model/model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from __future__ import annotations
2-
from abc import ABC, abstractmethod
1+
from abc import ABC, abstractmethod
32
from ..signature import Signature
43

54

src/lobe/results.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
import json
32
from typing import List, Dict
43

@@ -20,7 +19,7 @@ class ClassificationResult:
2019
"""
2120

2221
@classmethod
23-
def from_json(cls, json_str: str, labels: List[str] = None) -> ClassificationResult:
22+
def from_json(cls, json_str: str, labels: List[str] = None):
2423
"""
2524
Parse the classification results from a json string
2625
"""

src/lobe/signature.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
import os
32
import json
43
import pathlib

0 commit comments

Comments
 (0)