|
|
|
|
@ -10,6 +10,8 @@ import rq
|
|
|
|
|
import shutil
|
|
|
|
|
import tempfile
|
|
|
|
|
import itertools
|
|
|
|
|
import sys
|
|
|
|
|
import traceback
|
|
|
|
|
|
|
|
|
|
from django.db import transaction
|
|
|
|
|
from django.utils import timezone
|
|
|
|
|
@ -22,7 +24,7 @@ from cvat.apps.engine.serializers import LabeledDataSerializer
|
|
|
|
|
from cvat.apps.engine.annotation import put_task_data, patch_task_data
|
|
|
|
|
|
|
|
|
|
from .models import AnnotationModel, FrameworkChoice
|
|
|
|
|
from .model_loader import ModelLoader
|
|
|
|
|
from .model_loader import ModelLoader, load_labelmap
|
|
|
|
|
from .image_loader import ImageLoader
|
|
|
|
|
from .import_modules import import_modules
|
|
|
|
|
|
|
|
|
|
@ -44,11 +46,12 @@ def _update_dl_model_thread(dl_model_id, name, is_shared, model_file, weights_fi
|
|
|
|
|
def _run_test(model_file, weights_file, labelmap_file, interpretation_file):
|
|
|
|
|
test_image = np.ones((1024, 1980, 3), np.uint8) * 255
|
|
|
|
|
try:
|
|
|
|
|
dummy_labelmap = {key: key for key in load_labelmap(labelmap_file).keys()}
|
|
|
|
|
run_inference_engine_annotation(
|
|
|
|
|
data=[test_image,],
|
|
|
|
|
model_file=model_file,
|
|
|
|
|
weights_file=weights_file,
|
|
|
|
|
labels_mapping=labelmap_file,
|
|
|
|
|
labels_mapping=dummy_labelmap,
|
|
|
|
|
attribute_spec={},
|
|
|
|
|
convertation_file=interpretation_file,
|
|
|
|
|
restricted=restricted
|
|
|
|
|
@ -370,7 +373,6 @@ def run_inference_engine_annotation(data, model_file, weights_file,
|
|
|
|
|
|
|
|
|
|
add_shapes(processed_detections.get_shapes(), result["shapes"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
def run_inference_thread(tid, model_file, weights_file, labels_mapping, attributes, convertation_file, reset, user, restricted=True):
|
|
|
|
|
|