Skip to content
Snippets Groups Projects
Commit 4cd4481e authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

[doc] only run mtcnn example when tf is available

parent c8c88696
No related branches found
No related tags found
1 merge request!13Port mtcnn to Tensorflow 2
Pipeline #45856 passed
...@@ -3,14 +3,18 @@ from bob.io.base import load ...@@ -3,14 +3,18 @@ from bob.io.base import load
from bob.io.base.test_utils import datafile from bob.io.base.test_utils import datafile
from bob.io.image import imshow from bob.io.image import imshow
from bob.ip.facedetect.mtcnn import MTCNN from bob.ip.facedetect.mtcnn import MTCNN
from bob.ip.facedetect.tests.utils import is_library_available
from matplotlib.patches import Circle from matplotlib.patches import Circle
from matplotlib.patches import Rectangle from matplotlib.patches import Rectangle
# load colored test image # load colored test image
color_image = load(datafile("test_image_multi_face.png", "bob.ip.facedetect")) color_image = load(datafile("test_image_multi_face.png", "bob.ip.facedetect"))
is_tf_available = True
try:
import tensorflow
except Exception:
is_tf_available = False
if not is_library_available("tensorflow"): if not is_tf_available:
imshow(color_image) imshow(color_image)
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment