本文整理匯總了Python中torchvision.get_image_backend方法的典型用法代碼示例。如果您正苦於以下問題:Python torchvision.get_image_backend方法的具體用法?Python torchvision.get_image_backend怎麽用?Python torchvision.get_image_backend使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類torchvision
的用法示例。
在下文中一共展示了torchvision.get_image_backend方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: default_loader
# 需要導入模塊: import torchvision [as 別名]
# 或者: from torchvision import get_image_backend [as 別名]
def default_loader(path):
from torchvision import get_image_backend
if get_image_backend() == 'accimage':
return accimage_loader(path)
else:
return pil_loader(path)
示例2: get_default_image_loader
# 需要導入模塊: import torchvision [as 別名]
# 或者: from torchvision import get_image_backend [as 別名]
def get_default_image_loader():
from torchvision import get_image_backend
if get_image_backend() == 'accimage':
return accimage_loader
else:
return pil_loader
示例3: image_loader
# 需要導入模塊: import torchvision [as 別名]
# 或者: from torchvision import get_image_backend [as 別名]
def image_loader(path):
from torchvision import get_image_backend
if get_image_backend() == 'accimage':
return accimage_loader(path)
else:
return pil_loader(path)
示例4: default_loader
# 需要導入模塊: import torchvision [as 別名]
# 或者: from torchvision import get_image_backend [as 別名]
def default_loader(path):
from torchvision import get_image_backend
if get_image_backend() == 'PIL':
return pil_loader(path)
else:
logging.info("Something went wrong with the default_loader in image_folder_segmentation.py")
sys.exit(-1)
示例5: default_loader
# 需要導入模塊: import torchvision [as 別名]
# 或者: from torchvision import get_image_backend [as 別名]
def default_loader(path):
from torchvision import get_image_backend
if get_image_backend() == 'accimage':
return accimage_loader(path)
else:
return pil_loader(path)
示例6: default_loader
# 需要導入模塊: import torchvision [as 別名]
# 或者: from torchvision import get_image_backend [as 別名]
def default_loader(path):
from torchvision import get_image_backend
if get_image_backend() == 'accimage':
return accimage_loader(path)
else:
return pil_loader(path)
#index image file folder