update template code

This commit is contained in:
phatakmr
2025-10-13 14:48:00 +02:00
parent c9d159fcc6
commit 8f637a4a0d
46 changed files with 2955 additions and 1 deletions

0
mmp/a1/__init__.py Normal file
View File

1002
mmp/a1/imagenet_classes.json Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
mmp/a1/images/koala.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

BIN
mmp/a1/images/pacifier.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
mmp/a1/images/shoehorn.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
mmp/a1/images/zoo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

32
mmp/a1/main.py Normal file
View File

@@ -0,0 +1,32 @@
from typing import Sequence
import torch
def build_batch(paths: Sequence[str], transform=None) -> torch.Tensor:
"""Exercise 1.1
@param paths: A sequence (e.g. list) of strings, each specifying the location of an image file.
@param transform: One or multiple image transformations for augmenting the batch images.
@return: Returns one single tensor that contains every image.
"""
raise NotImplementedError()
def get_model() -> torch.nn.Module:
"""Exercise 1.2
@return: Returns a neural network, initialised with pretrained weights.
"""
raise NotImplementedError()
def main():
"""Exercise 1.3
Put all your code for exercise 1.3 here.
"""
raise NotImplementedError()
if __name__ == "__main__":
main()

10
mmp/a1/tensors.py Normal file
View File

@@ -0,0 +1,10 @@
import torch
def avg_color(img: torch.Tensor):
raise NotImplementedError()
def mask(foreground: torch.Tensor, background: torch.Tensor, mask_tensor: torch.Tensor, threshold: float):
raise NotImplementedError()
def add_matrix_vector(matrix: torch.Tensor, vector: torch.Tensor):
raise NotImplementedError()