提交 e3997705 编写于 作者: C chenjian

fix import bug for vision utils

上级 bac08ec0
...@@ -11,15 +11,17 @@ ...@@ -11,15 +11,17 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import os import os
from typing import Callable, Union, List, Tuple from typing import Callable
from typing import List
from typing import Tuple
from typing import Union
import cv2 import cv2
import paddle
import PIL
import numpy as np import numpy as np
import paddle
import paddle.nn.functional as F import paddle.nn.functional as F
import PIL.Image
from scipy.sparse import csr_matrix from scipy.sparse import csr_matrix
...@@ -129,8 +131,7 @@ def draw_boxes_on_image(image_path: str, ...@@ -129,8 +131,7 @@ def draw_boxes_on_image(image_path: str,
x1, y1, x2, y2 = box[0], box[1], box[2], box[3] x1, y1, x2, y2 = box[0], box[1], box[2], box[3]
rect = plt.Rectangle((x1, y1), x2 - x1, y2 - y1, fill=False, linewidth=2.0, edgecolor=colors[label]) rect = plt.Rectangle((x1, y1), x2 - x1, y2 - y1, fill=False, linewidth=2.0, edgecolor=colors[label])
ax.add_patch(rect) ax.add_patch(rect)
ax.text( ax.text(x1,
x1,
y1, y1,
'{} {:.4f}'.format(label_names[label], score), '{} {:.4f}'.format(label_names[label], score),
verticalalignment='bottom', verticalalignment='bottom',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册