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,17 +24,20 @@ class Image:
self.path = path
self.rgb = None
def getRGB(self, cache=False):
if self.rgb is not None:
return self.rgb
def getBGR(self):
try:
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:
try:
rgb = io.imread(self.path)
except:
rgb = None
if cache:
self.rgb = rgb
return rgb
rgb = None
return rgb
def __repr__(self):
return "({}, {})".format(self.cls, self.name)