|
1 | | -[](https://classroom.github.com/a/15CTOpCR) |
2 | | -# Deep Learning E1394 - Tutorial |
3 | | - |
4 | | -## Submitting your work |
5 | | - |
6 | | -Once the deadline has passed, you are not able to push to your repository anymore or update it in any other way and all changes on the main branch will be considered for grading. In other words, there is no "submit" button which you need to press. You just need to ensure that all your work has been pushed / uploaded to GitHub before the deadline. |
7 | | - |
8 | | -Uploading a new or edited file to GitHub involves three steps: |
9 | | -1. Add the file to the staging area: |
10 | | - ``` |
11 | | - git add <file to be added> |
12 | | - ``` |
13 | | -2. Create a commit: |
14 | | - ``` |
15 | | - git commit -m <commit msg - briefly describe your change> |
16 | | - ``` |
17 | | -3. Push the local commit to GitHub: |
18 | | - ``` |
19 | | - git push |
20 | | - ``` |
21 | | -
|
22 | | -To avoid conflicts when multiple people are working on the same file, we recommend to push your changes as frequently as possible and always pull the latest changes from GitHub before you start working. Also, as a nice teammate, test your changes before you push them and use meaninful commit messages to make it easy to understand your changes. |
23 | | -
|
24 | | -## Asking for help |
25 | | -
|
26 | | -If you have important questions or believe to have spotted an error, please open an issue on your repository and mention the teaching assistant with @chiara-fb and @henrycgbaker. |
27 | | -
|
28 | | -## Useful Links |
29 | | -* Git best practices: https://gist.github.com/luismts/495d982e8c5b1a0ced4a57cf3d93cf60 |
30 | | -* How to write a good git commit message: https://cbea.ms/git-commit/ |
31 | | -* Book "Dive into Deep Learning": https://d2l.ai/ |
32 | | -* Tutorial on pushing and submitting work with GitHub classroom: https://www.youtube.com/watch?v=jXpT8eOzzCM |
33 | | -* Neural network from scratch: |
34 | | - * https://towardsdatascience.com/math-neural-network-from-scratch-in-python-d6da9f29ce65 |
35 | | - * https://pythonalgos.com/create-a-neural-network-from-scratch-in-python-3/ |
36 | | - * https://github.com/casperbh96/Neural-Network-From-Scratch/blob/master/NN_From_Scratch.ipynb |
37 | | - * https://www.codingame.com/playgrounds/59631/neural-network-xor-example-from-scratch-no-libs |
| 1 | +# Few-Shot Learning for Rooftop Detection in Satellite Imagery |
| 2 | + |
| 3 | +## Tutorial Overview |
| 4 | + |
| 5 | +This tutorial demonstrates few-shot learning techniques for semantic segmentation of satellite imagery. The dataset contains high-resolution satellite images of Geneva, Switzerland, with corresponding segmentation labels for rooftop detection. |
| 6 | + |
| 7 | +📓 **[View Tutorial Notebook (HTML)](docs/tutorial_few_shot_learning.html)** |
| 8 | + |
| 9 | +### Learning Outcomes |
| 10 | +- Understanding few-shot learning concepts for image segmentation |
| 11 | +- Working with satellite imagery and segmentation masks |
| 12 | +- Implementing and evaluating few-shot learning models for rooftop detection |
| 13 | + |
| 14 | +## Video Tutorial |
| 15 | + |
| 16 | +<!-- VIDEO PLACEHOLDER: Replace the link below with your tutorial video --> |
| 17 | +[](https://www.youtube.com/watch?v=VIDEO_ID) |
| 18 | + |
| 19 | +*Click the image above to watch the tutorial video* |
| 20 | + |
| 21 | +## Quick Start |
| 22 | + |
| 23 | +### Installation |
| 24 | + |
| 25 | +```bash |
| 26 | +# Clone the repository |
| 27 | +git clone https://github.com/elenaivadreyer/tutorial-group-1.git |
| 28 | +cd tutorial-group-1 |
| 29 | + |
| 30 | +# Create virtual environment |
| 31 | +python3 -m venv .venv |
| 32 | +source .venv/bin/activate |
| 33 | + |
| 34 | +# Install the package (without PyTorch) |
| 35 | +pip install -e . |
| 36 | + |
| 37 | +# Install PyTorch (CPU-only version recommended to save disk space) |
| 38 | +# CPU-only: ~730MB vs CUDA version: ~7GB |
| 39 | +pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu |
| 40 | + |
| 41 | +# Or use the Makefile |
| 42 | +make install |
| 43 | +make install-torch |
| 44 | +``` |
| 45 | + |
| 46 | +**Note:** PyTorch is not installed by default due to its large size. The CPU-only version is recommended for most use cases and saves significant disk space. |
| 47 | + |
| 48 | +### Running the Tutorial |
| 49 | + |
| 50 | +Open the main tutorial notebook: |
| 51 | +```bash |
| 52 | +jupyter notebook notebooks/tutorial_few_shot_learning.ipynb |
| 53 | +``` |
| 54 | + |
| 55 | +## Project Structure |
| 56 | + |
| 57 | +``` |
| 58 | +├── notebooks/ |
| 59 | +│ └── tutorial_few_shot_learning.ipynb # Main tutorial notebook |
| 60 | +├── src/few_shot_utils/ |
| 61 | +│ ├── __init__.py # Package initialization |
| 62 | +│ ├── data.py # Data loading utilities |
| 63 | +│ ├── models.py # Model architectures |
| 64 | +│ ├── train.py # Training functions |
| 65 | +│ └── evaluate.py # Evaluation metrics |
| 66 | +└── docs/ # Documentation |
| 67 | +``` |
| 68 | + |
| 69 | +## Dataset Description |
| 70 | + |
| 71 | +The dataset consists of: |
| 72 | +- **Satellite Images**: High-resolution RGB satellite images of Geneva, Switzerland |
| 73 | +- **Segmentation Labels**: Binary masks indicating rooftop locations |
| 74 | +- **Resolution**: Images at various resolutions suitable for few-shot learning |
| 75 | + |
| 76 | +## Development |
| 77 | + |
| 78 | +### Linting and Formatting |
| 79 | + |
| 80 | +This project uses [Ruff](https://docs.astral.sh/ruff/) for linting and formatting, including Jupyter notebooks. |
| 81 | + |
| 82 | +```bash |
| 83 | +# Run linting with automatic fixes |
| 84 | +ruff check . --fix |
| 85 | +ruff format . |
| 86 | + |
| 87 | +# Run pre-commit hooks |
| 88 | +pre-commit run --all-files |
| 89 | +``` |
| 90 | + |
| 91 | +## References |
| 92 | + |
| 93 | +- |
| 94 | +- |
| 95 | + |
| 96 | +## License |
| 97 | + |
| 98 | +This project is licensed under the MIT License - see the LICENSE file for details. |
0 commit comments