20 lines
503 B
Python
20 lines
503 B
Python
|
import torch
|
||
|
import cv2
|
||
|
import torchvision
|
||
|
import torch.nn as nn
|
||
|
import torch.nn.functional as F
|
||
|
import torchvision.transforms as transforms
|
||
|
import matplotlib.pyplot as plt
|
||
|
import numpy as np
|
||
|
import torch.optim as optim
|
||
|
from PIL import Image
|
||
|
import os
|
||
|
|
||
|
|
||
|
for filename in os.listdir('./resources/smieci/plastic'):
|
||
|
|
||
|
img = Image.open('./resources/smieci/plastic/'+filename)
|
||
|
pil_to_tensor = transforms.ToTensor()(img).unsqueeze_(0)
|
||
|
if(str(pil_to_tensor.shape[1]) == '1'):
|
||
|
print(filename)
|