我的问题就是在这段代码中,default_image_loader函数没有use_jpeg4py属性,怎么用了default_image_loader.use_jpeg4py,而且在工程的其他文件中也再也没有出现关于use_jpeg4py的任何东西。所以这个是怎么理解啊
import jpeg4py
import cv2
from PIL import Image
def default_image_loader(path):
if default_image_loader.use_jpeg4py is None:
im = jpeg4py_loader(path)
if im is None:
default_image_loader.use_jpeg4py = False
else:
default_image_loader.use_jpeg4py = True
return im
if default_image_loader.use_jpeg4py:
return jpeg4_loader(path)
return opencv_loader(path)
default_image_loader.use_jpeg4py = None
def jpeg4py_loader(path):
pass
def opencv_loader(path):
pass