Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
#
#-------------------------------------------------------------------------------
from __future__ import division
from Tkinter import *
import tkMessageBox
try:
import tkinter
import tkinter.messagebox
except:
import Tkinter as tkinter
import tkMessageBox
from tkinter import *
from PIL import Image, ImageTk
import os
import glob
Expand Down Expand Up @@ -133,7 +138,7 @@ def loadDir(self, dbg = False):
self.imageDir = os.path.join(r'./Images', '%03d' %(self.category))
self.imageList = glob.glob(os.path.join(self.imageDir, '*.JPEG'))
if len(self.imageList) == 0:
print 'No .JPEG images found in the specified dir!'
print ('No .JPEG images found in the specified dir!')
return

# default to the 1st image in the collection
Expand Down Expand Up @@ -164,7 +169,7 @@ def loadDir(self, dbg = False):
self.egLabels[i].config(image = self.egList[-1], width = SIZE[0], height = SIZE[1])

self.loadImage()
print '%d images loaded from %s' %(self.total, s)
print ('%d images loaded from %s' %(self.total, s))

def loadImage(self):
# load image
Expand Down Expand Up @@ -203,7 +208,7 @@ def saveImage(self):
f.write('%d\n' %len(self.bboxList))
for bbox in self.bboxList:
f.write(' '.join(map(str, bbox)) + '\n')
print 'Image No. %d saved' %(self.cur)
print ('Image No. %d saved' %(self.cur))


def mouseClick(self, event):
Expand Down