-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved errors related to importing modules
- Loading branch information
1 parent
b785d65
commit b40c386
Showing
15 changed files
with
69 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ torch | |
torchvision | ||
numpy | ||
pandas | ||
torchsummary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .dataset import * | ||
from .models import * | ||
from .utils import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from classification import ClassificationDataset | ||
from segmentation import SegmentationDataset | ||
from .classification import ClassificationDataset | ||
from .segmentation import SegmentationDataset |
Binary file modified
BIN
+20 Bytes
(100%)
UniTrain/dataset/__pycache__/classification.cpython-311.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from classification import ResNet9 | ||
from segmentation import UNet | ||
from .classification import ResNet9 | ||
from .segmentation import UNet |
Binary file modified
BIN
+20 Bytes
(100%)
UniTrain/models/__pycache__/classification.cpython-311.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from models.segmentation import UNet | ||
from utils.segmentation import parse_folder, get_data_loader, train_unet | ||
from torchvision import transforms | ||
import glob | ||
|
||
|
||
def main(): | ||
if parse_folder('data'): | ||
|
||
|
||
# Make Your Custom Data Transformations | ||
# transform = transforms.Compose([ | ||
# transforms.Resize((224, 224)), # Resize images to a fixed size | ||
# transforms.ToTensor(), # Convert images to PyTorch tensors | ||
# transforms.Normalize((0.485, 0.456, 0.406), | ||
# (0.229, 0.224, 0.225)) # Normalize with ImageNet stats | ||
# ]) | ||
train_image_paths = glob.glob("data/train/images/*.jpg") | ||
train_mask_paths = glob.glob("data/train/masks/*.png") | ||
|
||
test_image_paths = glob.glob("data/test/images/*.jpg") | ||
test_mask_paths = glob.glob("data/test/masks/*.png") | ||
|
||
print(train_image_paths, train_mask_paths, test_image_paths, test_mask_paths) | ||
|
||
train_dataloader = get_data_loader(train_image_paths,train_mask_paths, 1, True) | ||
test_dataloader = get_data_loader(test_image_paths, test_mask_paths, 1, True) | ||
|
||
model = UNet(n_class=20) | ||
|
||
train_unet(model, train_dataloader, test_dataloader, num_epochs=10, learning_rate=1e-3, checkpoint_dir='checkpoints') | ||
|
||
else: | ||
print("Invalid dataset folder.") | ||
return None | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from classification import get_data_loader, parse_folder, train_model | ||
from segmentation import get_data_loader, parse_folder, train_unet, generate_model_summary, get_iou_score | ||
from .classification import get_data_loader, parse_folder, train_model | ||
from .segmentation import get_data_loader, parse_folder, train_unet, generate_model_summary, iou_score |
Binary file modified
BIN
+457 Bytes
(110%)
UniTrain/utils/__pycache__/classification.cpython-311.pyc
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters