Permalink
Browse files

Updated `image` package loads images regardless of extension

  • Loading branch information...
1 parent e7073f4 commit c2bc628fd8956e0391676af7de0caedd71f584c0 @abhshkdz abhshkdz committed Feb 6, 2016
Showing with 1 addition and 12 deletions.
  1. +1 −12 prepro_img.lua
View
@@ -35,19 +35,8 @@ net=loadcaffe.load(opt.cnn_proto, opt.cnn_model,opt.backend);
net:evaluate()
net=net:cuda()
-imloader={}
-function imloader:load(fname)
- self.im="rip"
- if not pcall(function () self.im=image.load(fname); end) then
- if not pcall(function () self.im=image.loadPNG(fname); end) then
- if not pcall(function () self.im=image.loadJPG(fname); end) then
- end
- end
- end
-end
function loadim(imname)
- imloader:load(imname)
- im=imloader.im
+ im=image.load(imname)
im=image.scale(im,224,224)
if im:size(1)==1 then
im2=torch.cat(im,im,1)

0 comments on commit c2bc628

Please sign in to comment.