changed dockerfile and bird dataset

This commit is contained in:
2026-05-12 04:32:19 +02:00
parent fe963e0a68
commit 58af9f0f82
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
Copy . .
COPY . .
RUN chmod +x start_server.sh
+4 -2
View File
@@ -24,12 +24,14 @@ class bird_species(Enum):
Sarus_Crane = 6
transform = transforms.Compose([
transforms.RandomHorizontalFlip(p=0.5),
transforms.RandomRotation(35),
transforms.Resize(IMAGE_SIZE),
transforms.CenterCrop(IMAGE_SIZE),
transforms.ToTensor()
])
dataset = datasets.ImageFolder("data/train", transform=transform)
dataset = datasets.ImageFolder("data/CUB_200_2011/images", transform=transform)
train_size = int(0.8 * len(dataset))
val_size = len(dataset) - train_size
@@ -43,7 +45,7 @@ val_loader = DataLoader(val_dataset, batch_size=32, shuffle=False)
device = torch.device("cpu") if not torch.cuda.is_available() else torch.device("cuda:0")
print("Using device", device)
model = Bird_CNN(c_in=3, c_hidden=16, c_out=7)
model = Bird_CNN(c_in=3, c_hidden=16, c_out=200)
model.to(device)
optimizer = torch.optim.Adam(model.parameters(), lr=1e-3, weight_decay=1e-4)
loss_module = nn.CrossEntropyLoss()