Skip to content

Commit 0d65e82

Browse files
Merge pull request #24 from renan-siqueira/develop
Merge develop into main
2 parents 4745af9 + 4bb382a commit 0d65e82

File tree

3 files changed

+50
-5
lines changed

3 files changed

+50
-5
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This project aims to provide a basic framework for understanding, training, and
1313
- Save and load trained model weights.
1414
- Utilize custom datasets by simply pointing to your directory.
1515
- Test all available autoencoder architectures with a single command.
16+
- Easily containerize and run using Docker.
1617

1718
## Getting Started
1819

@@ -23,12 +24,32 @@ This project aims to provide a basic framework for understanding, training, and
2324
- torchvision
2425
- PIL
2526
- matplotlib
27+
- Docker (if you want to containerize the application)
2628

2729
### Installation
2830

31+
#### Traditional Setup:
32+
2933
1. Clone the repository.
3034
2. Navigate to the project directory and install the required libraries.
3135

36+
#### Using Docker:
37+
38+
1. Clone the repository.
39+
2. Navigate to the project directory.
40+
3. Build the Docker image:
41+
42+
```bash
43+
docker build -t autoencoder_research .
44+
```
45+
46+
4. Run the container:
47+
```bash
48+
docker run -it --rm -v $(pwd):/app autoencoder_research bash
49+
```
50+
51+
**Note:** If you're using the Docker method, you'll be inside the container's shell after running the above command. You can execute Python scripts or any other commands just like you would on your local machine.
52+
3253
## Usage
3354

3455
1. Modify the `settings/settings.py` file to point to your training and validation dataset.
@@ -51,3 +72,29 @@ python run.py --test
5172
```
5273

5374
This will train each autoencoder for a few epochs and provide an overview of their performances.
75+
76+
## Common Issues and Solutions
77+
78+
### Issue: Docker Volume and Uppercase Paths on Windows
79+
80+
**Description:** On Windows, when trying to mount a local volume in Docker, an error might arise if the path contains uppercase letters. This is due to Docker expecting repository names (or paths) to be in lowercase.
81+
82+
**Solution:** Convert the current directory path to lowercase and replace backslashes with regular slashes. If you're using Git Bash or a similar terminal on Windows, follow the steps below:
83+
84+
1. Get the full path of the current directory in Windows format:
85+
86+
```bash
87+
win_path=$(pwd -W)
88+
```
89+
90+
2. Convert the path to lowercase and replace backslashes with regular slashes:
91+
92+
```bash
93+
lowercase_path=$(echo $win_path | tr '[:upper:]' '[:lower:]' | sed 's|\\|/|g')
94+
```
95+
96+
3. Use this path in your Docker command:
97+
98+
```bash
99+
docker run -it --rm -v "/$lowercase_path":/app autoencoder_research bash
100+
```

reset_dataset.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ def reset_dataset():
66
train_path = os.path.join(dataset_path, "train")
77
valid_path = os.path.join(dataset_path, "valid")
88

9-
# Remove as pastas se existirem
109
if os.path.exists(train_path):
1110
shutil.rmtree(train_path)
1211
if os.path.exists(valid_path):
1312
shutil.rmtree(valid_path)
1413

15-
# Recria as pastas
1614
os.makedirs(train_path)
1715
os.makedirs(valid_path)
1816

settings/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
# COPY RANDOMIC FILES
88
COPY_SOURCE_FOLDER = 'C:/Users/Meu Computador/Desktop/projetos/00-Datasets/processed_videos/Jinjer_Vortex_REACTION_ANALYSIS_by_Vocal_Coach_Opera_Singer/original/face'
99

10-
COPY_DESTINATION_FOLDER = 'dataset/train'
11-
# COPY_DESTINATION_FOLDER = 'dataset/valid'
10+
# COPY_DESTINATION_FOLDER = 'dataset/train'
11+
COPY_DESTINATION_FOLDER = 'dataset/valid'
1212

1313
COPY_PERCENTAGE_TO_COPY = None
1414
COPY_RANDOM_MODE = True
15-
COPY_FIXED_NUMBER_TO_COPY = 1600
15+
COPY_FIXED_NUMBER_TO_COPY = 32

0 commit comments

Comments
 (0)