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,16 +24,19 @@ 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:
return self.rgb
else:
try: try:
rgb = io.imread(self.path) bgr = cv2.imread(self.path)
except: 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 rgb = None
if cache:
self.rgb = rgb
return rgb return rgb
def __repr__(self): def __repr__(self):