Spaces:
Runtime error
Runtime error
Ubuntu
commited on
Commit
·
3752748
1
Parent(s):
9ad98c1
- .ipynb_checkpoints/app-checkpoint.py +2 -4
- .ipynb_checkpoints/requirements-checkpoint.txt +3 -3
- app.py +2 -4
- requirements.txt +3 -3
.ipynb_checkpoints/app-checkpoint.py
CHANGED
@@ -23,6 +23,7 @@ class ImageClassificationCollator:
|
|
23 |
encodings = self.feature_extractor([x[0] for x in batch], return_tensors='pt')
|
24 |
encodings['labels'] = torch.tensor([x[1] for x in batch], dtype=torch.long)
|
25 |
return encodings
|
|
|
26 |
class Classifier(pl.LightningModule):
|
27 |
|
28 |
def __init__(self, model, lr: float = 2e-5, **kwargs):
|
@@ -54,10 +55,7 @@ def video_identity(video,user_name,class_name,trainortest,ready):
|
|
54 |
if ready=='yes':
|
55 |
|
56 |
data_dir = Path(str(user_name)+'/train')
|
57 |
-
|
58 |
-
transforms.ToTensor(),
|
59 |
-
transforms.ConvertImageDtype(torch.float)
|
60 |
-
])
|
61 |
train_ds = ImageFolder(data_dir, transform=transform)
|
62 |
|
63 |
|
|
|
23 |
encodings = self.feature_extractor([x[0] for x in batch], return_tensors='pt')
|
24 |
encodings['labels'] = torch.tensor([x[1] for x in batch], dtype=torch.long)
|
25 |
return encodings
|
26 |
+
|
27 |
class Classifier(pl.LightningModule):
|
28 |
|
29 |
def __init__(self, model, lr: float = 2e-5, **kwargs):
|
|
|
55 |
if ready=='yes':
|
56 |
|
57 |
data_dir = Path(str(user_name)+'/train')
|
58 |
+
|
|
|
|
|
|
|
59 |
train_ds = ImageFolder(data_dir, transform=transform)
|
60 |
|
61 |
|
.ipynb_checkpoints/requirements-checkpoint.txt
CHANGED
@@ -2,7 +2,7 @@ opencv-python
|
|
2 |
encoded-video
|
3 |
torch==2.0.0
|
4 |
numpy
|
5 |
-
pytorch-lightning
|
6 |
-
torchvision
|
7 |
-
transformers
|
8 |
pathlib
|
|
|
2 |
encoded-video
|
3 |
torch==2.0.0
|
4 |
numpy
|
5 |
+
pytorch-lightning==2.0.1
|
6 |
+
torchvision==0.15.1
|
7 |
+
transformers==4.29.0
|
8 |
pathlib
|
app.py
CHANGED
@@ -23,6 +23,7 @@ class ImageClassificationCollator:
|
|
23 |
encodings = self.feature_extractor([x[0] for x in batch], return_tensors='pt')
|
24 |
encodings['labels'] = torch.tensor([x[1] for x in batch], dtype=torch.long)
|
25 |
return encodings
|
|
|
26 |
class Classifier(pl.LightningModule):
|
27 |
|
28 |
def __init__(self, model, lr: float = 2e-5, **kwargs):
|
@@ -54,10 +55,7 @@ def video_identity(video,user_name,class_name,trainortest,ready):
|
|
54 |
if ready=='yes':
|
55 |
|
56 |
data_dir = Path(str(user_name)+'/train')
|
57 |
-
|
58 |
-
transforms.ToTensor(),
|
59 |
-
transforms.ConvertImageDtype(torch.float)
|
60 |
-
])
|
61 |
train_ds = ImageFolder(data_dir, transform=transform)
|
62 |
|
63 |
|
|
|
23 |
encodings = self.feature_extractor([x[0] for x in batch], return_tensors='pt')
|
24 |
encodings['labels'] = torch.tensor([x[1] for x in batch], dtype=torch.long)
|
25 |
return encodings
|
26 |
+
|
27 |
class Classifier(pl.LightningModule):
|
28 |
|
29 |
def __init__(self, model, lr: float = 2e-5, **kwargs):
|
|
|
55 |
if ready=='yes':
|
56 |
|
57 |
data_dir = Path(str(user_name)+'/train')
|
58 |
+
|
|
|
|
|
|
|
59 |
train_ds = ImageFolder(data_dir, transform=transform)
|
60 |
|
61 |
|
requirements.txt
CHANGED
@@ -2,7 +2,7 @@ opencv-python
|
|
2 |
encoded-video
|
3 |
torch==2.0.0
|
4 |
numpy
|
5 |
-
pytorch-lightning
|
6 |
-
torchvision
|
7 |
-
transformers
|
8 |
pathlib
|
|
|
2 |
encoded-video
|
3 |
torch==2.0.0
|
4 |
numpy
|
5 |
+
pytorch-lightning==2.0.1
|
6 |
+
torchvision==0.15.1
|
7 |
+
transformers==4.29.0
|
8 |
pathlib
|