Remove skimage dependency for #50.

This commit is contained in:
Brandon Amos 2015-12-08 16:41:40 -05:00
parent a78043923b
commit a1a89ea65f
3 changed files with 14 additions and 16 deletions

View File

@ -25,8 +25,6 @@ import random
import cv2
from skimage import io
import openface
from openface.alignment import NaiveDlib
from openface.data import iterImgs

View File

@ -20,8 +20,6 @@ import os
import random
import sys
from skimage import io
from .. import helper
from .. import data

View File

@ -14,8 +14,7 @@
import os
from skimage import io
import cv2
class Image:
@ -25,16 +24,19 @@ class Image:
self.path = path
self.rgb = None
def getRGB(self, cache=False):
if self.rgb is not None:
return self.rgb
else:
def getBGR(self):
try:
rgb = io.imread(self.path)
bgr = cv2.imread(self.path)
except:
bgr = None
return bgr
def getRGB(self):
bgr = self.getBGR()
if bgr is not None:
rgb = cv2.cvtColor(bgr, cv2.COLOR_BGR2RGB)
else:
rgb = None
if cache:
self.rgb = rgb
return rgb
def __repr__(self):