Skip to content

Commit a85deb9

Browse files
committed
Remove unused imports
1 parent 3d7d530 commit a85deb9

File tree

14 files changed

+26
-25
lines changed

14 files changed

+26
-25
lines changed

backend/config/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ class Config:
6161
MASK_RCNN_CLASSES = os.getenv("MASK_RCNN_CLASSES", "BG")
6262

6363
DEXTR_FILE = os.getenv("DEXTR_FILE", "/models/dextr_pascal-sbd.h5")
64+
65+
66+
__all__ = ["Config"]

backend/database/tasks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,7 @@ def api_json(self):
9393
return {
9494
"id": self.id,
9595
"name": self.name
96-
}
96+
}
97+
98+
99+
__all__ = ["TaskModel"]

backend/webserver/api/annotations.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from flask_restplus import Namespace, Resource, reqparse
22
from flask_login import login_required, current_user
3-
from imantics import Color
43

54
from database import AnnotationModel
65
from ..util import query_util
@@ -67,9 +66,7 @@ def get(self, annotation_id):
6766

6867
if annotation is None:
6968
return {"message": "Invalid annotation id"}, 400
70-
71-
image = current_user.images.filter(id=annotation.image_id, deleted=False).first()
72-
69+
7370
return query_util.fix_ids(annotation)
7471

7572
@login_required

backend/webserver/api/info.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from flask_restplus import Namespace, Resource, reqparse
1+
from flask_restplus import Namespace, Resource
22

33
from workers.tasks import long_task
44
from config import Config
5-
from ..util.version_util import get_tag
65
from database import UserModel, TaskModel
76

87

backend/webserver/api/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def post(self, image_id):
4949

5050
args = dextr_args.parse_args()
5151
points = args.get('points')
52-
padding = args.get('padding')
53-
threshold = args.get('threshold')
52+
# padding = args.get('padding')
53+
# threshold = args.get('threshold')
5454

5555
if len(points) != 4:
5656
return {"message": "Invalid points entered"}, 400

backend/webserver/api/tasks.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from flask_restplus import Namespace, Resource, reqparse
2-
from flask_login import login_required, current_user
1+
from flask_restplus import Namespace, Resource
2+
from flask_login import login_required
33

44
from ..util import query_util
5-
from config import Config
65
from database import TaskModel
76

87

backend/webserver/authentication.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
from flask_login import LoginManager, login_user, login_required, logout_user, current_user, AnonymousUserMixin
1+
from flask_login import LoginManager, AnonymousUserMixin
22
from database import (
33
UserModel,
44
DatasetModel,
55
CategoryModel,
66
AnnotationModel,
77
ImageModel
88
)
9-
from config import Config
109

1110
login_manager = LoginManager()
1211

backend/webserver/sockets.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import functools
2-
import json
32
import time
43

54
from flask import session

backend/webserver/util/dextr.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from dextr import DEXTR
22
from ..config import Config
3-
import os
43

54

65
model = DEXTR(nb_classes=1, resnet_layers=101, input_shape=(512, 512), weights_path=Config.DEXTR_FILE,

backend/webserver/util/mask_rcnn.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
from config import Config as AnnotatorConfig
22
from skimage.transform import resize
33
import imantics as im
4-
import cv2
54

65
from keras.preprocessing.image import img_to_array
76
from mrcnn.config import Config
8-
import mrcnn.utils as utils
97
import mrcnn.model as modellib
10-
import numpy as np
118

129

1310
MODEL_DIR = "/workspace/models"
@@ -44,7 +41,7 @@ def __init__(self):
4441

4542
def detect(self, image):
4643

47-
if self.model == None:
44+
if self.model is None:
4845
return {}
4946

5047
image = image.convert('RGB')
@@ -56,7 +53,6 @@ def detect(self, image):
5653

5754
masks = result.get('masks')
5855
class_ids = result.get('class_ids')
59-
scores = result.get('scores')
6056

6157
coco_image = im.Image(width=width, height=height)
6258

0 commit comments

Comments
 (0)