From 1c66012ac9ccca6c9e8a3dcf24f737c1a0f734c7 Mon Sep 17 00:00:00 2001
From: Lianmin Zheng <mercy_zheng@sjtu.edu.cn>
Date: Sun, 19 Aug 2018 19:29:35 -0700
Subject: [PATCH] fix import (#1621)

---
 nnvm/python/nnvm/testing/yolo2_detection.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/nnvm/python/nnvm/testing/yolo2_detection.py b/nnvm/python/nnvm/testing/yolo2_detection.py
index b7744c45c..0b229149b 100644
--- a/nnvm/python/nnvm/testing/yolo2_detection.py
+++ b/nnvm/python/nnvm/testing/yolo2_detection.py
@@ -10,9 +10,6 @@ from __future__ import division
 import math
 from collections import namedtuple
 import numpy as np
-from PIL import Image
-from PIL import ImageDraw
-from PIL import ImageFont
 
 def _entry_index(batch, w, h, outputs, classes, coords, location, entry):
     n = int(location/(w*h))
@@ -186,6 +183,10 @@ def _draw_label(im, r, c, label, rgb):
                         _set_pixel(im, i+c, j+r, k, val)#rgb[k] * val)
 
 def _get_label(labelstr, rgb):
+    from PIL import Image
+    from PIL import ImageDraw
+    from PIL import ImageFont
+
     text = labelstr
     colorText = "black"
     testDraw = ImageDraw.Draw(Image.new('RGB', (1, 1)))
-- 
GitLab