update template code
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 159 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 65 KiB |
@@ -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()
|
||||
@@ -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()
|
||||