diff --git a/deploy/python/mot_jde_infer.py b/deploy/python/mot_jde_infer.py index 584fcb384e65d2aa1a59025f2f3f522fe75262e8..8e37d1b7a421183f1bb02a931afc95f3c44499c1 100644 --- a/deploy/python/mot_jde_infer.py +++ b/deploy/python/mot_jde_infer.py @@ -251,8 +251,7 @@ def predict_video(detector, camera_id): if not os.path.exists(save_dir): os.makedirs(save_dir) cv2.imwrite( - os.path.join(save_dir, '{:05d}.jpg'.format(frame_id)), - im) + os.path.join(save_dir, '{:05d}.jpg'.format(frame_id)), im) else: writer.write(im) frame_id += 1 diff --git a/deploy/python/mot_sde_infer.py b/deploy/python/mot_sde_infer.py index 60a3fd7db92e40749c8f19079b305ed6849aa310..6e1a4036f9851cf5077b691db65695f618d30363 100644 --- a/deploy/python/mot_sde_infer.py +++ b/deploy/python/mot_sde_infer.py @@ -392,8 +392,7 @@ def predict_video(detector, reid_model, camera_id): if not os.path.exists(save_dir): os.makedirs(save_dir) cv2.imwrite( - os.path.join(save_dir, '{:05d}.jpg'.format(frame_id)), - im) + os.path.join(save_dir, '{:05d}.jpg'.format(frame_id)), im) else: writer.write(im) frame_id += 1 diff --git a/deploy/python/utils.py b/deploy/python/utils.py index 138cefcd33e2b3f5a962f4c5c2ff2d2b0470294e..c35364c01765ea842a3bc0d16eaf089f674e717e 100644 --- a/deploy/python/utils.py +++ b/deploy/python/utils.py @@ -229,4 +229,3 @@ def get_current_memory_mb(): meminfo = pynvml.nvmlDeviceGetMemoryInfo(handle) gpu_mem = meminfo.used / 1024. / 1024. return round(cpu_mem, 4), round(gpu_mem, 4), round(gpu_percent, 4) - diff --git a/deploy/serving/test_client.py b/deploy/serving/test_client.py index b6a688e22a5ff47c01b6471506fe10d39a3ac32c..176ef9e8fc6b48524039125c019be463a12556dc 100644 --- a/deploy/serving/test_client.py +++ b/deploy/serving/test_client.py @@ -41,4 +41,3 @@ fetch_map = client.predict( print(fetch_map) fetch_map["image"] = sys.argv[1] postprocess(fetch_map) - diff --git a/docs/tutorials/FAQ/README.md b/docs/tutorials/FAQ/README.md index d4541c7c322c4da227e08c2684c6e338996890e0..67d688600f1e93455f5ac700ff1b51fcc1bbb375 100644 --- a/docs/tutorials/FAQ/README.md +++ b/docs/tutorials/FAQ/README.md @@ -4,4 +4,3 @@ - [FAQ:第零期](./FAQ第零期.md) - [FAQ:第一期](./FAQ第一期.md) - diff --git a/ppdet/data/transform/mot_operators.py b/ppdet/data/transform/mot_operators.py index 5af64bb4418dd8011839c80c15be4a18fd1cdddc..9ad9389a6b288aa104e64d4caec9bdf4477a89d7 100644 --- a/ppdet/data/transform/mot_operators.py +++ b/ppdet/data/transform/mot_operators.py @@ -108,7 +108,9 @@ class LetterBoxResize(BaseOperator): if not isinstance(im, np.ndarray): raise TypeError("{}: image type is not numpy.".format(self)) if len(im.shape) != 3: - raise ImageError('{}: image is not 3-dimensional.'.format(self)) + from PIL import UnidentifiedImageError + raise UnidentifiedImageError( + '{}: image is not 3-dimensional.'.format(self)) # apply image height, width = self.target_size @@ -135,7 +137,7 @@ class MOTRandomAffine(BaseOperator): Args: degrees (list[2]): the rotate range to apply, transform range is [min, max] - translate (list[2]): the translate range to apply, ransform range is [min, max] + translate (list[2]): the translate range to apply, transform range is [min, max] scale (list[2]): the scale range to apply, transform range is [min, max] shear (list[2]): the shear range to apply, transform range is [min, max] borderValue (list[3]): value used in case of a constant border when appling diff --git a/ppdet/engine/trainer.py b/ppdet/engine/trainer.py index c7e80fffbb8fd3a38eb980b36a31d1303d0afa6f..87712e8adeb437fa598b095ee6e502c22773381f 100644 --- a/ppdet/engine/trainer.py +++ b/ppdet/engine/trainer.py @@ -17,6 +17,7 @@ from __future__ import division from __future__ import print_function import os +import sys import copy import time diff --git a/ppdet/modeling/losses/sparsercnn_loss.py b/ppdet/modeling/losses/sparsercnn_loss.py index 72b3b2fbc25708d1b443507cf9336a227a1d94c8..d8fc3d117b499d6ca32ab8275b5dc1f8ba86cae5 100644 --- a/ppdet/modeling/losses/sparsercnn_loss.py +++ b/ppdet/modeling/losses/sparsercnn_loss.py @@ -357,7 +357,7 @@ def boxes_iou(boxes1, boxes2): ''' area1 = box_area(boxes1) area2 = box_area(boxes2) - + lt = paddle.maximum(boxes1.unsqueeze(-2)[:, :, :2], boxes2[:, :2]) rb = paddle.minimum(boxes1.unsqueeze(-2)[:, :, 2:], boxes2[:, 2:])