Spaces:
Sleeping
Sleeping
randomshit11
commited on
Commit
•
f429adb
1
Parent(s):
118cd16
Delete model.py
Browse files
model.py
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
import torch.nn as nn
|
3 |
-
import torch.optim as optim
|
4 |
-
import torchvision.transforms as transforms
|
5 |
-
from torchvision import models
|
6 |
-
from PIL import Image
|
7 |
-
import os
|
8 |
-
import random
|
9 |
-
|
10 |
-
|
11 |
-
class ResNet50(nn.Module):
|
12 |
-
def __init__(self):
|
13 |
-
super(ResNet50, self).__init__()
|
14 |
-
self.resnet = models.resnet50(pretrained=True)
|
15 |
-
for param in self.resnet.parameters():
|
16 |
-
param.requires_grad = False
|
17 |
-
self.resnet.fc = nn.Sequential(
|
18 |
-
nn.Linear(2048, 2)
|
19 |
-
)
|
20 |
-
|
21 |
-
def forward(self, x):
|
22 |
-
x = self.resnet(x)
|
23 |
-
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|