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 import cv2
from skimage import io
import openface import openface
from openface.alignment import NaiveDlib from openface.alignment import NaiveDlib
from openface.data import iterImgs from openface.data import iterImgs

View File

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

View File

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