Skip to content

Commit 636becd

Browse files
authored
Merge pull request cocodataset#280 from Johnqczhang/master
fix unicode error in python3
2 parents aca78bc + f67e873 commit 636becd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PythonAPI/pycocotools/coco.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def loadRes(self, resFile):
305305

306306
print('Loading and preparing results...')
307307
tic = time.time()
308-
if type(resFile) == str or type(resFile) == unicode:
308+
if type(resFile) == str or (PYTHON_VERSION == 2 and type(resFile) == unicode):
309309
anns = json.load(open(resFile))
310310
elif type(resFile) == np.ndarray:
311311
anns = self.loadNumpyAnnotations(resFile)

0 commit comments

Comments
 (0)