update template code
2
.gitignore
vendored
@@ -1,2 +1,2 @@
|
||||
.venv/
|
||||
*.code-workspace
|
||||
__pycache__/
|
||||
|
||||
21
.gitlab-ci.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
cache:
|
||||
key: "project-${CI_JOB_NAME}"
|
||||
paths:
|
||||
- .torch-home
|
||||
# cache installs from previous tests
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
unit-test-job:
|
||||
stage: test
|
||||
image: mmp-img-test # in the test environment, no CUDA is available
|
||||
before_script:
|
||||
- export TORCH_HOME="$CI_PROJECT_DIR/.torch-home"
|
||||
script:
|
||||
- pytest tests/ --junitxml=report.xml # export in junit format for GitLab
|
||||
# generate a report on GitLab
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
junit: report.xml
|
||||
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
10
Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
# you can safely ignore this file for the course
|
||||
# this dockerfile is used for the test runner
|
||||
# you do not need docker for this course
|
||||
|
||||
# use just a standard python container, no CUDA will be available for the tests
|
||||
FROM python:3.10
|
||||
COPY requirements.txt .
|
||||
RUN pip install -U pip
|
||||
RUN pip install -r requirements.txt
|
||||
RUN rm requirements.txt
|
||||
69
README.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# Multimediaprojekt SoSe 2025
|
||||
|
||||
## General Information
|
||||
- All assignments build on each other
|
||||
- You will be rewarded points for the assignments
|
||||
- Your grades will be calculated from the achieved points
|
||||
- You submit by uploading to this git repository
|
||||
|
||||
## Plagiarism
|
||||
Please make sure to read the following carefully:
|
||||
|
||||
Assignments are **individual** implementation tasks. This means that you will have to code by yourself. Like every programmer, you may use the internet to find solutions to the various problems that you will encounter throughout this course. However, we will not tolerate plagiarism and license violations. Plagiarism can have serious consequences that go beyond failing this course. Therefore, make sure you are allowed to use the code and properly mark code that you did not write yourselves. Note that we cannot award points for code that you simply copied from any third parties including any of your fellow students.
|
||||
|
||||
## Assignment Submission
|
||||
You can find the submission date on top of each assignment. However, we might deviate from this, so check your e-mails regularly.
|
||||
|
||||
You must use this git repository to submit your solutions. For each assignment, we have prepared template code that you must use for your submission. You must not change the function signatures or move them to other files. This may seem a little strict, but it allows for a more thorough correction which will hopefully assist you for future assignments.
|
||||
|
||||
|
||||
When an assignment is due, we will use the last commit before the deadline as your submission.
|
||||
Your code must contain all necessary files to run your submission.
|
||||
|
||||
#### Your repository must include
|
||||
|
||||
- Source code files (`*.py`)
|
||||
- Supplementary files (`*.jpg`, `*.png`, `*.txt`, ...)
|
||||
- If you are asked to answer a question, explain, report, plot, or visualize something, you are required to submit a report document in pdf format containing the requested details.
|
||||
- Capsule the code that is executed in a main method (`if __name__ == '__main__':`), so that it is not executed if a method is imported from your codefile
|
||||
|
||||
#### Your repository must exclude
|
||||
|
||||
- Jupyter notebooks (`*.ipynb`)
|
||||
- Do not submit your Python Environment or the dataset
|
||||
- Larger files. Upload them to https://megastore.uni-augsburg.de instead. Save the download link to a text file and add it to the repository. Do **not** use any other cloud storage or filesharing service than Megastore.
|
||||
|
||||
Points will be deducted if any of the above requirements are violated.
|
||||
|
||||
## Automatic Tests
|
||||
|
||||
When you push your local changes to the git server, the server will check if your code is in the right format. On the website, you will see a green checkmark if the check is successful. However, the server only tests some basic structure of your code and the points will be awarded later. In theory, you could have a green checkmark and 0 points.
|
||||
|
||||
**IMPORTANT:** If this basic test fails and your last commit before the deadline has a red cross, you will loose a lot of points!
|
||||
|
||||
Do not modify `.gitlab-ci.yml` or the contents of the `tests` folder.
|
||||
|
||||
## Assignment Preparation
|
||||
|
||||
Set up your environment by installing the following software.
|
||||
|
||||
### Python 3
|
||||
Downloads available at https://www.python.org/. Choose to install pip (package installer for python) during the installation.
|
||||
|
||||
### Virtual Environment
|
||||
Make yourself familiar to the concept of virtual environments. If you don't know what a virtual environment is, see this [Tutorial on Python Virtual Environments on Windows](https://www.youtube.com/watch?v=APOPm01BVrk) or [MAC/Linux](https://www.youtube.com/watch?v=Kg1Yvry_Ydk).
|
||||
Create a virtual environment for your project.
|
||||
|
||||
### Packages
|
||||
Install the packages from the `requirements.txt` file.
|
||||
|
||||
Your assignments will be tested in an environment where only these packages are installed. If your code does not run in this environment, you will lose points. Depending on your platform and if you have a nvidia GPU and want to use it, see https://pytorch.org for the right command to install PyTorch. The torchvision package is also part of PyTorch and provides some useful methods to handle images.
|
||||
|
||||
### Python IDE
|
||||
We recommend the Pycharm Professional Edition available at https://www.jetbrains.com/pycharm/download/. You need to register a student account to get free access. Start Pycharm and create a new project that uses your recently created python environment. You can do this by changing the project interpreter to the python binary that resides inside your virtual environment.
|
||||
|
||||
Windows: `venv\textbackslash Scripts\textbackslash python.exe`
|
||||
|
||||
Linux: `venv/bin/python`
|
||||
|
||||
We can help you with this IDE, but not with any other one.
|
||||
0
mmp/__init__.py
Normal file
0
mmp/a1/__init__.py
Normal file
1002
mmp/a1/imagenet_classes.json
Normal file
BIN
mmp/a1/images/golden retriever.jpg
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
mmp/a1/images/koala.jpg
Normal file
|
After Width: | Height: | Size: 159 KiB |
BIN
mmp/a1/images/pacifier.jpg
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
mmp/a1/images/rubber duck sculpture.jpg
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
mmp/a1/images/rubber ducks.jpg
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
mmp/a1/images/shoehorn.jpg
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
mmp/a1/images/zoo.jpg
Normal file
|
After Width: | Height: | Size: 65 KiB |
32
mmp/a1/main.py
Normal 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
@@ -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()
|
||||
0
mmp/a2/__init__.py
Normal file
89
mmp/a2/main.py
Normal file
@@ -0,0 +1,89 @@
|
||||
from typing import Tuple
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.optim as optim
|
||||
from torch.utils.data import DataLoader
|
||||
|
||||
# these are the labels from the Cifar10 dataset:
|
||||
CLASSES = (
|
||||
"plane",
|
||||
"car",
|
||||
"bird",
|
||||
"cat",
|
||||
"deer",
|
||||
"dog",
|
||||
"frog",
|
||||
"horse",
|
||||
"ship",
|
||||
"truck",
|
||||
)
|
||||
|
||||
|
||||
class MmpNet(nn.Module):
|
||||
"""Exercise 2.1"""
|
||||
|
||||
def __init__(self, num_classes: int):
|
||||
raise NotImplementedError()
|
||||
|
||||
def forward(self, x: torch.Tensor):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def get_dataloader(
|
||||
is_train: bool, data_root: str, batch_size: int, num_workers: int
|
||||
) -> DataLoader:
|
||||
"""Exercise 2.2
|
||||
|
||||
@param is_train: Whether this is the training or validation split
|
||||
@param data_root: Where to download the dataset to
|
||||
@param batch_size: Batch size for the data loader
|
||||
@param num_workers: Number of workers for the data loader
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def get_criterion_optimizer(model: nn.Module) -> Tuple[nn.Module, optim.Optimizer]:
|
||||
"""Exercise 2.3a
|
||||
|
||||
@param model: The model that is being trained.
|
||||
@return: Returns a tuple of the criterion and the optimizer.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def train_epoch(
|
||||
model: nn.Module,
|
||||
loader: DataLoader,
|
||||
criterion: nn.Module,
|
||||
optimizer: optim.Optimizer,
|
||||
device: torch.device,
|
||||
):
|
||||
"""Exercise 2.3b
|
||||
|
||||
@param model: The model that should be trained
|
||||
@param loader: The DataLoader that contains the training data
|
||||
@param criterion: The criterion that is used to calculate the loss for backpropagation
|
||||
@param optimizer: Executes the update step
|
||||
@param device: The device where the epoch should run on
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def eval_epoch(model: nn.Module, loader: DataLoader, device: torch.device) -> float:
|
||||
"""Exercise 2.3c
|
||||
|
||||
@param model: The model that should be evaluated
|
||||
@param loader: The DataLoader that contains the evaluation data
|
||||
@param device: The device where the epoch should run on
|
||||
|
||||
@return: Returns the accuracy over the full validation dataset as a float."""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def main():
|
||||
"""Exercise 2.3d"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
0
mmp/a3/__init__.py
Normal file
27
mmp/a3/annotation.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from typing import List
|
||||
import numpy as np
|
||||
|
||||
|
||||
class AnnotationRect:
|
||||
"""Exercise 3.1"""
|
||||
|
||||
def __init__(self, x1, y1, x2, y2):
|
||||
raise NotImplementedError()
|
||||
|
||||
def area(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
def __array__(self) -> np.ndarray:
|
||||
raise NotImplementedError()
|
||||
|
||||
@staticmethod
|
||||
def fromarray(arr: np.ndarray):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def read_groundtruth_file(path: str) -> List[AnnotationRect]:
|
||||
"""Exercise 3.1b"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
# put your solution for exercise 3.1c wherever you deem it right
|
||||
29
mmp/a3/dataset.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from typing import Tuple
|
||||
import torch
|
||||
from torch.utils.data import DataLoader
|
||||
|
||||
|
||||
class MMP_Dataset(torch.utils.data.Dataset):
|
||||
"""Exercise 3.2"""
|
||||
|
||||
def __init__(self, path_to_data: str, image_size: int):
|
||||
"""
|
||||
@param path_to_data: Path to the folder that contains the images and annotation files, e.g. dataset_mmp/train
|
||||
@param image_size: Desired image size that this dataset should return
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def __getitem__(self, idx: int) -> Tuple[torch.Tensor, int]:
|
||||
"""
|
||||
@return: Tuple of image tensor and label. The label is 0 if there is one person and 1 if there a multiple people.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def __len__(self) -> int:
|
||||
raise NotImplementedError()
|
||||
|
||||
def get_dataloader(
|
||||
path_to_data: str, image_size: int, batch_size: int, num_workers: int, is_train: bool = True
|
||||
) -> DataLoader:
|
||||
|
||||
"""Exercise 3.2d"""
|
||||
7
mmp/a3/main.py
Normal file
@@ -0,0 +1,7 @@
|
||||
def main():
|
||||
"""Put your code for Exercise 3.3 in here"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
12
mmp/a4/anchor_grid.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from typing import Sequence
|
||||
import numpy as np
|
||||
|
||||
|
||||
def get_anchor_grid(
|
||||
num_rows: int,
|
||||
num_cols: int,
|
||||
scale_factor: float,
|
||||
anchor_widths: Sequence[float],
|
||||
aspect_ratios: Sequence[float],
|
||||
) -> np.ndarray:
|
||||
raise NotImplementedError()
|
||||
50
mmp/a4/dataset.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from typing import Tuple
|
||||
import numpy as np
|
||||
import torch
|
||||
from torch.utils.data import DataLoader
|
||||
|
||||
|
||||
class MMP_Dataset(torch.utils.data.Dataset):
|
||||
def __init__(
|
||||
self,
|
||||
path_to_data: str,
|
||||
image_size: int,
|
||||
anchor_grid: np.ndarray,
|
||||
min_iou: float,
|
||||
is_test: bool,
|
||||
):
|
||||
"""
|
||||
@param anchor_grid: The anchor grid to be used for every image
|
||||
@param min_iou: The minimum IoU that is required for an overlap for the label grid.
|
||||
@param is_test: Whether this is the test set (True) or the validation/training set (False)
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def __getitem__(self, idx: int) -> Tuple[torch.Tensor, torch.Tensor, int]:
|
||||
"""
|
||||
@return: 3-tuple of image tensor, label grid, and image (file-)number
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def __len__(self) -> int:
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def get_dataloader(
|
||||
path_to_data: str,
|
||||
image_size: int,
|
||||
batch_size: int,
|
||||
num_workers: int,
|
||||
anchor_grid: np.ndarray,
|
||||
is_test: bool,
|
||||
) -> DataLoader:
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def calculate_max_coverage(loader: DataLoader, min_iou: float) -> float:
|
||||
"""
|
||||
@param loader: A DataLoader object, generated with the get_dataloader function.
|
||||
@param min_iou: Minimum IoU overlap that is required to count a ground truth box as covered.
|
||||
@return: Ratio of how mamy ground truth boxes are covered by a label grid box. Must be a value between 0 and 1.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
14
mmp/a4/label_grid.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from typing import Sequence
|
||||
import numpy as np
|
||||
|
||||
from ..a3.annotation import AnnotationRect
|
||||
|
||||
|
||||
def iou(rect1: AnnotationRect, rect2: AnnotationRect) -> float:
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def get_label_grid(
|
||||
anchor_grid: np.ndarray, gts: Sequence[AnnotationRect], min_iou: float
|
||||
) -> tuple[np.ndarray, ...]:
|
||||
raise NotImplementedError()
|
||||
39
mmp/a5/main.py
Normal file
@@ -0,0 +1,39 @@
|
||||
import torch
|
||||
import torch.optim as optim
|
||||
|
||||
from .model import MmpNet
|
||||
|
||||
|
||||
def step(
|
||||
model: MmpNet,
|
||||
criterion,
|
||||
optimizer: optim.Optimizer,
|
||||
img_batch: torch.Tensor,
|
||||
lbl_batch: torch.Tensor,
|
||||
) -> float:
|
||||
"""Performs one update step for the model
|
||||
|
||||
@return: The loss for the specified batch. Return a float and not a PyTorch tensor
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def get_random_sampling_mask(labels: torch.Tensor, neg_ratio: float) -> torch.Tensor:
|
||||
"""
|
||||
@param labels: The label tensor that is returned by your data loader.
|
||||
The values are either 0 (negative label) or 1 (positive label).
|
||||
@param neg_ratio: The desired negative/positive ratio.
|
||||
Hint: after computing the mask, check if the neg_ratio is fulfilled.
|
||||
@return: A tensor with the same shape as labels
|
||||
"""
|
||||
assert labels.min() >= 0 and labels.max() <= 1 # remove this line if you want
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def main():
|
||||
"""Put your training code for exercises 5.2 and 5.3 here"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
9
mmp/a5/model.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import torch
|
||||
|
||||
|
||||
class MmpNet(torch.nn.Module):
|
||||
def __init__(self, num_widths: int, num_aspect_ratios: int):
|
||||
raise NotImplementedError()
|
||||
|
||||
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
||||
raise NotImplementedError()
|
||||
102
mmp/a6/evallib.py
Normal file
@@ -0,0 +1,102 @@
|
||||
import numpy as np
|
||||
from ..a4.label_grid import iou
|
||||
|
||||
|
||||
def _assign_detections(det_boxes_scores, gt_boxes, min_iou):
|
||||
"""Returns a list of 3-tuples (det_box, det_score, closest_gt_box)"""
|
||||
|
||||
assert min_iou > 0, "min_iou should be greater than zero"
|
||||
det2gt = []
|
||||
for det_box, det_score in det_boxes_scores:
|
||||
# get all GTs that overlap at least by 0.5 and sort descending by overlap
|
||||
best_iou = -1.0
|
||||
closest_gt_box = None
|
||||
for gt in gt_boxes:
|
||||
curr_iou = iou(gt, det_box)
|
||||
if curr_iou > best_iou:
|
||||
best_iou = curr_iou
|
||||
closest_gt_box = gt
|
||||
|
||||
if best_iou >= min_iou:
|
||||
det2gt.append((det_box, det_score, closest_gt_box))
|
||||
else:
|
||||
det2gt.append((det_box, det_score, None))
|
||||
|
||||
return det2gt
|
||||
|
||||
|
||||
def calculate_ap_pr(det_boxes_scores: dict, gt_boxes: dict, min_iou=0.5):
|
||||
"""
|
||||
Calculates average precision for the given detections and ground truths.
|
||||
This function also calculates precision and recall values that can be used to plot a PR curve
|
||||
|
||||
@param det_boxes_scores: A dictionary that maps image numbers to a list of tuples,
|
||||
containing detected AnnotationRect objects and a score.
|
||||
@param gt_boxes: A dictionary that maps image numbers to the list of ground truth AnnotationRect objects.
|
||||
"""
|
||||
|
||||
for dets in det_boxes_scores.values():
|
||||
assert all(
|
||||
isinstance(d, tuple) and len(d) == 2 for d in dets
|
||||
), "Your detection boxes must have scores"
|
||||
|
||||
assert (
|
||||
len(set(gt_boxes.keys()).intersection(det_boxes_scores.keys())) > 0
|
||||
), "The two dictionaries have no common keys. Maybe you have selected the wrong dataset?"
|
||||
|
||||
gts_total = 0
|
||||
|
||||
dets2gts_flat = []
|
||||
for img in gt_boxes:
|
||||
gts_total += len(gt_boxes[img])
|
||||
det2gts = _assign_detections(
|
||||
det_boxes_scores.get(img, []), gt_boxes[img], min_iou
|
||||
)
|
||||
dets2gts_flat.extend(det2gts)
|
||||
|
||||
# sort by detection confidence
|
||||
# p[1] is the score
|
||||
dets2gts_flat.sort(key=lambda p: p[1], reverse=True)
|
||||
|
||||
tp = np.zeros(len(dets2gts_flat), dtype=np.float32)
|
||||
fp = np.zeros(len(dets2gts_flat), dtype=np.float32)
|
||||
fn_cum = np.zeros(len(dets2gts_flat), dtype=np.float32)
|
||||
gts_seen = {None}
|
||||
for idx, (_det, _det_score, gt) in enumerate(dets2gts_flat):
|
||||
gt_prev_seen = gt in gts_seen
|
||||
# If detection was assigned to GT that was not previously assigned to anything-> TP
|
||||
tp[idx] = gt is not None and not gt_prev_seen
|
||||
# If detection was not assigned to GT or detection was assigned to a previously assigned GT -> FP
|
||||
fp[idx] = (gt is None) or gt_prev_seen
|
||||
# all gts that have not been assigned yet -> FN
|
||||
gts_seen.add(gt)
|
||||
fn_cum[idx] = gts_total - (len(gts_seen) - 1)
|
||||
|
||||
# dets2gts_flat i sorted by score, therefore we can calculate tp and fp with cumsum
|
||||
tp_cum = np.cumsum(tp)
|
||||
fp_cum = np.cumsum(fp)
|
||||
|
||||
precision = tp_cum / (tp_cum + fp_cum)
|
||||
recall = tp_cum / (tp_cum + fn_cum)
|
||||
average_prevision = np.trapz(precision, recall)
|
||||
return average_prevision, precision, recall
|
||||
|
||||
|
||||
# def example():
|
||||
# dboxes = {
|
||||
# "31": [
|
||||
# (AnnotationRect(1, 2, 3, 4), 0.234),
|
||||
# (AnnotationRect(9, 8, 7, 6), 2.431093),
|
||||
# ],
|
||||
# "32": [
|
||||
# (AnnotationRect(1, 2, 3, 4), 0.234),
|
||||
# (AnnotationRect(9, 8, 7, 6), 2.431093),
|
||||
# ],
|
||||
# # ...
|
||||
# }
|
||||
# gboxes = {
|
||||
# "31": [AnnotationRect(0, 3, 2, 3)],
|
||||
# "32": [AnnotationRect(9, 9, 12, 23), AnnotationRect(1, 2, 40, 40)],
|
||||
# }
|
||||
# ap, _, _ = calculate_ap_pr(dboxes, gboxes)
|
||||
# print("ap is", ap)
|
||||
40
mmp/a6/main.py
Normal file
@@ -0,0 +1,40 @@
|
||||
from typing import List, Tuple
|
||||
import torch
|
||||
import numpy as np
|
||||
|
||||
from ..a5.model import MmpNet
|
||||
from ..a3.annotation import AnnotationRect
|
||||
|
||||
|
||||
def batch_inference(
|
||||
model: MmpNet, images: torch.Tensor, device: torch.device, anchor_grid: np.ndarray
|
||||
) -> List[List[Tuple[AnnotationRect, float]]]:
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def evaluate() -> float: # feel free to change the arguments
|
||||
"""Evaluates a specified model on the whole validation dataset.
|
||||
|
||||
@return: AP for the validation set as a float.
|
||||
|
||||
You decide which arguments this function should receive
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def evaluate_test(): # feel free to change the arguments
|
||||
"""Generates predictions on the provided test dataset.
|
||||
This function saves the predictions to a text file.
|
||||
|
||||
You decide which arguments this function should receive
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def main():
|
||||
"""Put the surrounding training code here. The code will probably look very similar to last assignment"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
928
mmp/a6/model_output.txt
Normal file
@@ -0,0 +1,928 @@
|
||||
00009713 218 51 531 500 0.9992377758026123
|
||||
00009713 241 63 442 341 0.05638350173830986
|
||||
00009713 314 62 523 359 0.04272805154323578
|
||||
00009713 356 146 518 486 0.027418583631515503
|
||||
00009713 361 80 501 269 0.02033345028758049
|
||||
00009713 371 303 511 502 0.016882028430700302
|
||||
00009713 182 82 332 421 0.011045699007809162
|
||||
00009713 268 56 418 202 0.010104012675583363
|
||||
00009713 349 425 503 512 0.009388841688632965
|
||||
00009713 269 206 427 500 0.008801761083304882
|
||||
00009713 287 420 431 512 0.006916396785527468
|
||||
00009713 372 53 518 187 0.006824038457125425
|
||||
00009713 3 0 139 267 0.005639121402055025
|
||||
00009713 455 119 589 400 0.00560223450884223
|
||||
00009713 191 95 316 266 0.004849089775234461
|
||||
00009713 194 169 298 331 0.003228328190743923
|
||||
00009713 431 42 622 218 0.002790184924378991
|
||||
00009713 273 346 421 474 0.0026446999981999397
|
||||
00009713 194 52 314 194 0.0025389627553522587
|
||||
00009713 195 232 308 434 0.002077374141663313
|
||||
00009713 473 180 586 319 0.0020562238059937954
|
||||
00009713 385 249 508 420 0.0019144380930811167
|
||||
00009713 270 180 411 324 0.0017681934405118227
|
||||
00009713 386 159 509 339 0.0015080178854987025
|
||||
00009713 373 145 496 222 0.0012623979710042477
|
||||
00009713 471 115 605 253 0.0012612993596121669
|
||||
00009713 245 121 465 239 0.0012237385381013155
|
||||
00009713 291 70 400 158 0.001207000226713717
|
||||
00009713 10 0 257 317 0.00101530144456774
|
||||
00009713 470 252 581 393 0.0009472385281696916
|
||||
00009713 282 263 413 402 0.0008254581480287015
|
||||
00009713 240 280 538 512 0.0007688302430324256
|
||||
00009713 11 6 95 74 0.0007474914309568703
|
||||
00009713 387 297 511 362 0.0006525561329908669
|
||||
00009713 286 129 683 474 0.0005818814388476312
|
||||
00009713 36 2 472 462 0.0005682968767359853
|
||||
00009713 184 220 293 292 0.0005486627924256027
|
||||
00009713 360 58 638 299 0.0005419111112132668
|
||||
00009713 451 240 602 511 0.0005035421927459538
|
||||
00009713 307 349 559 488 0.0005015279748477042
|
||||
00009713 555 13 683 194 0.0004701976431533694
|
||||
00009713 573 137 667 228 0.00044757628347724676
|
||||
00009713 75 12 231 214 0.000447265338152647
|
||||
00009713 371 367 509 454 0.0004257388354744762
|
||||
00009713 385 220 507 288 0.00038073325413279235
|
||||
00009713 158 24 354 236 0.00035600937553681433
|
||||
00009713 0 79 128 406 0.0003287547442596406
|
||||
00009713 303 279 546 401 0.0003173290169797838
|
||||
00009713 9 9 164 97 0.0003086021461058408
|
||||
00009713 14 24 113 180 0.0003060425806324929
|
||||
00009713 273 156 408 213 0.0003009705396834761
|
||||
00009713 279 231 407 283 0.00030007059103809297
|
||||
00009713 71 0 215 89 0.0002919489925261587
|
||||
00009713 246 419 581 512 0.0002787837292999029
|
||||
00009713 276 0 423 132 0.0002776375913526863
|
||||
00009713 472 68 595 154 0.0002671642287168652
|
||||
00009713 457 219 581 286 0.0002533297229092568
|
||||
00009713 76 113 242 381 0.00023223753669299185
|
||||
00009713 187 8 303 73 0.000222606016905047
|
||||
00009713 298 194 548 319 0.00021702505182474852
|
||||
00009713 134 207 268 297 0.00020666902128141373
|
||||
00009713 288 11 397 81 0.0002039782120846212
|
||||
00009713 171 0 323 134 0.0001967123826034367
|
||||
00009713 282 303 396 353 0.00019214724306948483
|
||||
00009713 181 270 337 512 0.0001880993804661557
|
||||
00009713 287 372 410 431 0.00018720832304097712
|
||||
00009713 86 115 509 341 0.0001758743019308895
|
||||
00009713 557 148 683 512 0.00017386412946507335
|
||||
00009713 187 294 303 363 0.00017254093836527318
|
||||
00009713 561 93 683 250 0.00016316788969561458
|
||||
00009713 44 0 434 227 0.00014413666212931275
|
||||
00009713 167 154 377 327 0.00013937256881035864
|
||||
00009713 292 29 683 196 0.00012797315139323473
|
||||
00009713 370 0 509 99 0.0001272348454222083
|
||||
00009713 16 91 268 507 0.00011757406173273921
|
||||
00009713 17 0 287 138 0.00011480335524538532
|
||||
00009713 549 459 677 502 0.00011015331256203353
|
||||
00009713 373 443 666 512 0.00010754197865026072
|
||||
00009713 456 294 590 360 0.00010586134885670617
|
||||
00014468 409 5 648 351 0.9735230803489685
|
||||
00014468 0 54 130 363 0.44076091051101685
|
||||
00014468 409 238 588 382 0.41775429248809814
|
||||
00014468 519 0 666 92 0.2504248321056366
|
||||
00014468 222 35 622 323 0.17690446972846985
|
||||
00014468 7 185 118 316 0.1115042045712471
|
||||
00014468 440 0 591 87 0.10381144285202026
|
||||
00014468 157 178 459 319 0.10139060020446777
|
||||
00014468 302 110 467 287 0.09870130568742752
|
||||
00014468 436 0 582 206 0.09038496017456055
|
||||
00014468 7 153 247 344 0.08151272684335709
|
||||
00014468 308 206 456 305 0.07829681038856506
|
||||
00014468 519 241 663 415 0.06633421033620834
|
||||
00014468 647 0 768 256 0.06180586293339729
|
||||
00014468 496 142 647 348 0.037872474640607834
|
||||
00014468 395 0 658 130 0.036778151988983154
|
||||
00014468 371 208 587 306 0.03397992253303528
|
||||
00014468 297 11 527 249 0.03205402195453644
|
||||
00014468 313 232 480 377 0.03200297802686691
|
||||
00014468 427 73 588 283 0.029695607721805573
|
||||
00014468 309 0 768 406 0.02609015442430973
|
||||
00014468 1 242 118 398 0.02604709193110466
|
||||
00014468 320 4 447 64 0.025225749239325523
|
||||
00014468 97 144 576 348 0.02415069378912449
|
||||
00014468 315 27 456 196 0.022448189556598663
|
||||
00014468 0 446 141 512 0.02237512730062008
|
||||
00014468 0 48 256 454 0.0199214369058609
|
||||
00014468 629 0 768 84 0.01908457651734352
|
||||
00014468 480 50 696 464 0.018058978021144867
|
||||
00014468 77 435 232 512 0.01586795225739479
|
||||
00014468 69 177 230 303 0.01513176504522562
|
||||
00014468 15 23 129 203 0.012557721696794033
|
||||
00014468 18 0 124 96 0.012197092175483704
|
||||
00014468 9 131 120 261 0.01200497429817915
|
||||
00014468 261 0 531 71 0.010978903621435165
|
||||
00014468 211 208 371 296 0.01010939385741949
|
||||
00014468 521 205 652 314 0.009653517045080662
|
||||
00014468 363 5 733 205 0.009641261771321297
|
||||
00014468 18 42 595 440 0.00883176364004612
|
||||
00014468 0 0 181 263 0.008783712051808834
|
||||
00014468 313 147 441 221 0.00830777920782566
|
||||
00014468 431 296 571 362 0.007992669939994812
|
||||
00014468 310 5 468 117 0.0076032062061131
|
||||
00014468 0 332 124 478 0.007124173454940319
|
||||
00014468 29 77 380 325 0.006255109328776598
|
||||
00014468 309 227 659 392 0.005658395122736692
|
||||
00014468 667 23 760 170 0.005383150186389685
|
||||
00014468 43 226 211 512 0.005345460958778858
|
||||
00014468 10 224 116 286 0.004777092020958662
|
||||
00014468 570 0 750 360 0.004515498876571655
|
||||
00014468 527 113 653 243 0.004187507554888725
|
||||
00014468 533 288 665 374 0.003978192340582609
|
||||
00014468 197 136 370 260 0.003923742566257715
|
||||
00014468 432 268 595 474 0.0029992053750902414
|
||||
00014468 644 166 761 470 0.0024739429354667664
|
||||
00014468 327 71 443 144 0.002247918862849474
|
||||
00014468 49 129 250 269 0.002185120014473796
|
||||
00014468 529 57 645 145 0.0021819998510181904
|
||||
00014468 56 4 546 257 0.0019006043439731002
|
||||
00014468 124 0 645 107 0.0018854559166356921
|
||||
00014468 525 230 637 287 0.0017206895863637328
|
||||
00014468 385 131 611 246 0.0015216664178296924
|
||||
00014468 476 41 680 158 0.0013784924522042274
|
||||
00014468 440 339 570 446 0.0013399936724454165
|
||||
00014468 6 302 107 358 0.0013254748191684484
|
||||
00014468 440 60 568 151 0.001188935129903257
|
||||
00014468 663 110 741 237 0.001175640500150621
|
||||
00014468 644 251 742 416 0.0011698382440954447
|
||||
00014468 657 179 752 333 0.0010792257962748408
|
||||
00014468 83 331 207 487 0.0010766894556581974
|
||||
00014468 412 151 628 509 0.0010367141803726554
|
||||
00014468 72 239 216 391 0.0010078402701765299
|
||||
00014468 205 244 362 372 0.0010065195383504033
|
||||
00014468 188 455 353 509 0.001006228500045836
|
||||
00014468 199 54 359 170 0.0009535890421830118
|
||||
00014468 329 303 471 361 0.0009530404349789023
|
||||
00014468 647 65 746 138 0.0009202142246067524
|
||||
00014468 427 457 547 501 0.0008598389686085284
|
||||
00014468 6 377 118 435 0.0007640997646376491
|
||||
00014468 56 14 246 228 0.0007406030199490488
|
||||
00014468 104 146 220 222 0.0006877986597828567
|
||||
00014468 158 220 440 403 0.0006747996085323393
|
||||
00014468 643 220 739 292 0.0006719886441715062
|
||||
00014468 217 159 352 212 0.0006317707011476159
|
||||
00014468 505 283 691 482 0.0006164428777992725
|
||||
00014468 191 162 695 458 0.0006032923120073974
|
||||
00014468 436 155 567 210 0.0005852437461726367
|
||||
00014468 528 157 643 211 0.000560874817892909
|
||||
00014468 656 308 744 465 0.0005311771528795362
|
||||
00014468 0 380 171 512 0.0005210476811043918
|
||||
00014468 312 272 471 485 0.0005162066081538796
|
||||
00014468 150 28 395 210 0.0005146207404322922
|
||||
00014468 99 431 469 512 0.0004906487301923335
|
||||
00014468 313 452 435 506 0.0004388469969853759
|
||||
00014468 226 84 362 137 0.00043012999230995774
|
||||
00014468 2 212 291 407 0.0004277551779523492
|
||||
00014468 205 12 358 61 0.0003826924948953092
|
||||
00014468 84 5 266 73 0.00037687510484829545
|
||||
00014468 317 338 439 452 0.00037506010266952217
|
||||
00014468 642 450 744 501 0.00037216124474070966
|
||||
00014468 74 226 211 283 0.0003604786761570722
|
||||
00014468 554 23 768 153 0.0003345779550727457
|
||||
00014468 541 331 667 456 0.00031569114071317017
|
||||
00014468 91 58 234 166 0.0003060665330849588
|
||||
00014468 647 157 729 211 0.00026765247457660735
|
||||
00014468 146 3 388 71 0.0002443758421577513
|
||||
00014468 101 374 223 447 0.00022916143643669784
|
||||
00014468 24 0 352 107 0.00022534155868925154
|
||||
00014468 15 81 125 146 0.00022204364358913153
|
||||
00014468 91 291 226 358 0.00022102090588305146
|
||||
00014468 638 289 743 365 0.0002095637610182166
|
||||
00014468 331 370 468 436 0.00020206336921546608
|
||||
00014468 337 448 551 509 0.00019877179875038564
|
||||
00014468 213 304 355 358 0.0001658054388826713
|
||||
00014468 426 405 573 512 0.00015460496069863439
|
||||
00014468 649 363 749 428 0.00011848975555039942
|
||||
00014468 562 437 739 492 0.00011737779277609661
|
||||
00014468 362 320 686 460 0.00011457992513896897
|
||||
00014468 208 350 322 460 0.00011263904889347032
|
||||
00014468 565 196 756 315 0.00010528942220844328
|
||||
00014468 306 411 458 512 0.00010313800885342062
|
||||
00015230 178 249 312 437 0.9959318041801453
|
||||
00015230 213 72 386 428 0.2688807249069214
|
||||
00015230 33 14 297 436 0.2494492083787918
|
||||
00015230 576 177 678 480 0.19585390388965607
|
||||
00015230 188 292 297 363 0.11881355941295624
|
||||
00015230 144 19 303 328 0.1107005700469017
|
||||
00015230 108 265 233 398 0.10564856976270676
|
||||
00015230 268 151 381 379 0.1039527952671051
|
||||
00015230 536 38 673 452 0.091851606965065
|
||||
00015230 295 40 581 512 0.06822070479393005
|
||||
00015230 4 270 119 508 0.06499487161636353
|
||||
00015230 170 229 279 286 0.061953481286764145
|
||||
00015230 407 2 658 442 0.050201401114463806
|
||||
00015230 103 195 230 357 0.03833271190524101
|
||||
00015230 166 89 276 268 0.031265269964933395
|
||||
00015230 249 0 426 350 0.029569445177912712
|
||||
00015230 75 315 230 471 0.028139572590589523
|
||||
00015230 274 193 362 316 0.024587228894233704
|
||||
00015230 180 350 309 449 0.02428106777369976
|
||||
00015230 110 31 442 456 0.022810660302639008
|
||||
00015230 300 29 384 339 0.02086961455643177
|
||||
00015230 274 326 402 462 0.01880483515560627
|
||||
00015230 199 289 447 480 0.01485055685043335
|
||||
00015230 343 157 506 474 0.01163405179977417
|
||||
00015230 131 291 332 504 0.011067722924053669
|
||||
00015230 1 357 288 512 0.009945414960384369
|
||||
00015230 578 68 666 314 0.00972050428390503
|
||||
00015230 2 0 119 332 0.00730498693883419
|
||||
00015230 83 57 220 338 0.00683275330811739
|
||||
00015230 171 28 308 196 0.006445717997848988
|
||||
00015230 492 90 625 419 0.006181038916110992
|
||||
00015230 209 435 487 512 0.006068288814276457
|
||||
00015230 586 321 667 454 0.005752839148044586
|
||||
00015230 28 430 264 511 0.00567103223875165
|
||||
00015230 142 429 329 512 0.005517907906323671
|
||||
00015230 0 156 113 391 0.005319138988852501
|
||||
00015230 104 218 214 292 0.005297711584717035
|
||||
00015230 276 283 382 378 0.005283021833747625
|
||||
00015230 286 102 361 251 0.005134196486324072
|
||||
00015230 4 443 113 506 0.004170606844127178
|
||||
00015230 372 254 492 419 0.0041236355900764465
|
||||
00015230 80 6 223 67 0.003493226831778884
|
||||
00015230 85 119 206 250 0.0034833878744393587
|
||||
00015230 171 80 300 142 0.0033243291545659304
|
||||
00015230 89 0 371 253 0.0032783772330731153
|
||||
00015230 580 201 681 308 0.00292400736361742
|
||||
00015230 73 250 536 512 0.0028666011057794094
|
||||
00015230 106 297 219 360 0.0026948906015604734
|
||||
00015230 0 255 206 447 0.002396118827164173
|
||||
00015230 171 11 306 66 0.0022646216675639153
|
||||
00015230 283 12 393 63 0.002249243203550577
|
||||
00015230 575 392 686 512 0.0021612492855638266
|
||||
00015230 83 198 371 353 0.0021533893886953592
|
||||
00015230 172 150 290 224 0.0019805317278951406
|
||||
00015230 272 455 423 509 0.0018809009343385696
|
||||
00015230 375 190 482 337 0.0018443414010107517
|
||||
00015230 252 355 438 507 0.0018138799350708723
|
||||
00015230 268 230 355 281 0.001625738455913961
|
||||
00015230 321 289 554 512 0.001601602416485548
|
||||
00015230 446 240 684 512 0.001572682405821979
|
||||
00015230 584 118 656 235 0.0014700503088533878
|
||||
00015230 63 402 438 512 0.0014373891754075885
|
||||
00015230 81 46 220 162 0.00140690291300416
|
||||
00015230 0 278 132 388 0.0013858119491487741
|
||||
00015230 114 0 364 74 0.0012928118230774999
|
||||
00015230 484 302 625 482 0.001271268934942782
|
||||
00015230 499 248 599 403 0.001168360118754208
|
||||
00015230 485 103 591 252 0.0011452098842710257
|
||||
00015230 561 440 669 505 0.0011047901352867484
|
||||
00015230 70 451 232 501 0.0010012248530983925
|
||||
00015230 529 161 681 352 0.0009972326224669814
|
||||
00015230 8 199 121 315 0.0009441319270990789
|
||||
00015230 279 2 400 223 0.000916606280952692
|
||||
00015230 491 168 595 318 0.0009148159297183156
|
||||
00015230 282 377 394 437 0.0009114544955082238
|
||||
00015230 105 67 335 151 0.0008766204700805247
|
||||
00015230 403 45 524 416 0.0008748723776079714
|
||||
00015230 363 15 516 56 0.0008612139499746263
|
||||
00015230 50 0 247 108 0.0008136475807987154
|
||||
00015230 36 13 267 200 0.0008048824965953827
|
||||
00015230 492 16 606 217 0.0008016278152354062
|
||||
00015230 582 33 663 176 0.0007212623604573309
|
||||
00015230 378 323 503 480 0.000717444228939712
|
||||
00015230 236 219 399 301 0.0006925383931957185
|
||||
00015230 5 361 105 449 0.0006493552937172353
|
||||
00015230 88 375 210 430 0.0006325744325295091
|
||||
00015230 379 227 494 293 0.0006269200821407139
|
||||
00015230 335 437 550 512 0.0006178041803650558
|
||||
00015230 503 44 586 157 0.0006124836509115994
|
||||
00015230 531 250 686 407 0.0005549605120904744
|
||||
00015230 549 19 665 61 0.0005369195714592934
|
||||
00015230 88 155 196 207 0.0005319862975738943
|
||||
00015230 234 239 650 447 0.0005251106922514737
|
||||
00015230 146 134 355 228 0.0004897980252280831
|
||||
00015230 222 0 462 67 0.00048801666707731783
|
||||
00015230 0 60 627 512 0.0004792926483787596
|
||||
00015230 1 299 106 356 0.0004750869993586093
|
||||
00015230 79 85 217 133 0.0004715617105830461
|
||||
00015230 274 153 377 218 0.00046576018212363124
|
||||
00015230 576 158 663 204 0.0004592995683196932
|
||||
00015230 8 24 110 187 0.00044759377487935126
|
||||
00015230 399 438 672 512 0.0003923877957277
|
||||
00015230 11 114 106 248 0.00037759292172268033
|
||||
00015230 278 54 378 156 0.0003370838821865618
|
||||
00015230 462 13 619 62 0.0003333610948175192
|
||||
00015230 490 148 588 215 0.00033139390870928764
|
||||
00015230 382 112 497 286 0.00030931030050851405
|
||||
00015230 187 404 686 512 0.00030819582752883434
|
||||
00015230 570 280 683 373 0.0003037074056919664
|
||||
00015230 469 377 643 512 0.00029880538932047784
|
||||
00015230 294 3 596 62 0.00029317126609385014
|
||||
00015230 482 220 584 289 0.0002869328309316188
|
||||
00015230 576 375 665 436 0.00028457085136324167
|
||||
00015230 159 0 561 313 0.00028411028324626386
|
||||
00015230 509 340 686 456 0.0002808108401950449
|
||||
00015230 385 289 494 371 0.00027951804804615676
|
||||
00015230 3 15 118 89 0.000273281242698431
|
||||
00015230 299 157 343 195 0.00026812852593138814
|
||||
00015230 489 84 588 131 0.0002570910146459937
|
||||
00015230 0 0 162 68 0.0002473231579642743
|
||||
00015230 398 46 503 170 0.00023022381355986
|
||||
00015230 487 366 600 444 0.00019754520326387137
|
||||
00015230 0 228 103 282 0.00018550784443505108
|
||||
00015230 568 74 652 139 0.00017890492745209485
|
||||
00015230 280 86 385 133 0.0001370907120872289
|
||||
00015230 534 142 681 213 0.00012998854799661785
|
||||
00015230 394 87 507 135 0.00012494646944105625
|
||||
00015230 470 455 626 506 0.00011189257202204317
|
||||
00015230 5 72 104 141 0.00011082242417614907
|
||||
00017984 538 173 634 479 0.9758561849594116
|
||||
00017984 261 129 373 445 0.4949325919151306
|
||||
00017984 346 144 458 437 0.44343745708465576
|
||||
00017984 309 0 479 187 0.4026491045951843
|
||||
00017984 47 141 189 458 0.3471282720565796
|
||||
00017984 10 265 108 442 0.2865073084831238
|
||||
00017984 174 181 283 437 0.24743126332759857
|
||||
00017984 1 6 105 214 0.2426595687866211
|
||||
00017984 315 19 481 389 0.21384383738040924
|
||||
00017984 404 0 566 85 0.20143844187259674
|
||||
00017984 542 186 627 322 0.18983417749404907
|
||||
00017984 38 29 483 480 0.18894675374031067
|
||||
00017984 459 233 547 383 0.18465028703212738
|
||||
00017984 257 0 538 97 0.13138219714164734
|
||||
00017984 346 234 444 373 0.12689857184886932
|
||||
00017984 354 50 459 275 0.1082889661192894
|
||||
00017984 105 98 328 464 0.10561501234769821
|
||||
00017984 65 270 176 441 0.10463956743478775
|
||||
00017984 252 218 354 377 0.08810015022754669
|
||||
00017984 543 234 638 371 0.07793550193309784
|
||||
00017984 198 73 405 464 0.07457202672958374
|
||||
00017984 542 52 637 337 0.06975558400154114
|
||||
00017984 285 22 375 316 0.06801705062389374
|
||||
00017984 58 405 213 478 0.06772372871637344
|
||||
00017984 0 0 118 98 0.06651414185762405
|
||||
00017984 0 0 504 137 0.06394131481647491
|
||||
00017984 343 31 457 140 0.06209742650389671
|
||||
00017984 265 3 415 64 0.06165854632854462
|
||||
00017984 551 350 640 480 0.05735442414879799
|
||||
00017984 452 188 542 323 0.05548981949687004
|
||||
00017984 59 46 185 319 0.05158618837594986
|
||||
00017984 0 148 96 331 0.05091795325279236
|
||||
00017984 340 180 448 316 0.050816427916288376
|
||||
00017984 221 0 462 273 0.050689149647951126
|
||||
00017984 367 0 591 143 0.03464897722005844
|
||||
00017984 349 106 446 223 0.033363234251737595
|
||||
00017984 278 90 356 224 0.031203508377075195
|
||||
00017984 157 402 284 477 0.026595542207360268
|
||||
00017984 0 0 300 80 0.024599652737379074
|
||||
00017984 396 109 605 480 0.024052482098340988
|
||||
00017984 267 180 369 306 0.023258449509739876
|
||||
00017984 547 111 632 239 0.022464999929070473
|
||||
00017984 301 219 475 393 0.02109949290752411
|
||||
00017984 170 248 276 359 0.019602710381150246
|
||||
00017984 19 335 109 414 0.019570162519812584
|
||||
00017984 533 1 640 205 0.01869731955230236
|
||||
00017984 5 0 228 199 0.01801302097737789
|
||||
00017984 266 20 405 175 0.01598801463842392
|
||||
00017984 180 296 267 437 0.01470915600657463
|
||||
00017984 77 251 191 361 0.013860350474715233
|
||||
00017984 73 108 175 223 0.012612282298505306
|
||||
00017984 1 352 107 480 0.012336566112935543
|
||||
00017984 526 413 635 480 0.01222901325672865
|
||||
00017984 340 271 443 335 0.011973942629992962
|
||||
00017984 258 73 534 480 0.011938601732254028
|
||||
00017984 496 1 640 92 0.011416708119213581
|
||||
00017984 346 208 460 276 0.01124538853764534
|
||||
00017984 491 9 640 427 0.010218174196779728
|
||||
00017984 260 270 344 438 0.010217254050076008
|
||||
00017984 445 269 544 340 0.00989519152790308
|
||||
00017984 121 262 300 453 0.009888404980301857
|
||||
00017984 427 51 576 346 0.009483912028372288
|
||||
00017984 487 177 640 351 0.009426653385162354
|
||||
00017984 363 280 448 450 0.009263766929507256
|
||||
00017984 73 174 177 291 0.008566944859921932
|
||||
00017984 29 331 227 480 0.007799222134053707
|
||||
00017984 389 221 602 389 0.007399847265332937
|
||||
00017984 237 270 347 336 0.007192984689027071
|
||||
00017984 446 122 548 227 0.007055722642689943
|
||||
00017984 431 27 554 137 0.006025912240147591
|
||||
00017984 45 25 194 154 0.005740707274526358
|
||||
00017984 470 270 640 460 0.0056888568215072155
|
||||
00017984 539 150 624 201 0.0055724214762449265
|
||||
00017984 266 139 372 209 0.005120808258652687
|
||||
00017984 545 209 627 270 0.005058073438704014
|
||||
00017984 73 335 180 413 0.004779793322086334
|
||||
00017984 351 75 451 125 0.004577530547976494
|
||||
00017984 122 1 344 62 0.004329141695052385
|
||||
00017984 18 233 231 412 0.004277946427464485
|
||||
00017984 8 396 332 480 0.004254643339663744
|
||||
00017984 446 322 583 480 0.004149259068071842
|
||||
00017984 0 414 131 476 0.003962669055908918
|
||||
00017984 542 44 639 142 0.00392248434945941
|
||||
00017984 175 193 301 300 0.0038470567669719458
|
||||
00017984 345 146 443 196 0.0036654917057603598
|
||||
00017984 527 313 640 437 0.0033379981759935617
|
||||
00017984 177 23 294 342 0.0033334356267005205
|
||||
00017984 258 213 362 265 0.0031698280945420265
|
||||
00017984 170 96 285 245 0.0031678564846515656
|
||||
00017984 328 0 640 329 0.0029770247638225555
|
||||
00017984 205 222 425 384 0.00297210062853992
|
||||
00017984 442 397 640 480 0.002924235537648201
|
||||
00017984 1 199 96 279 0.0026055932976305485
|
||||
00017984 78 146 188 191 0.0025824573822319508
|
||||
00017984 276 147 344 188 0.002413131296634674
|
||||
00017984 0 59 98 141 0.002408545231446624
|
||||
00017984 163 19 307 184 0.0023836123291403055
|
||||
00017984 0 133 96 209 0.002350326394662261
|
||||
00017984 268 65 396 139 0.002328172093257308
|
||||
00017984 170 282 273 330 0.002294263569638133
|
||||
00017984 0 0 146 366 0.0022621757816523314
|
||||
00017984 0 317 167 426 0.001978493295609951
|
||||
00017984 542 277 633 336 0.00182425940874964
|
||||
00017984 442 211 532 265 0.0018011685460805893
|
||||
00017984 76 214 179 259 0.0017821775982156396
|
||||
00017984 249 268 516 462 0.001736486330628395
|
||||
00017984 81 281 185 333 0.001576754031702876
|
||||
00017984 9 283 103 336 0.0015247806441038847
|
||||
00017984 0 270 372 466 0.0015093388501554728
|
||||
00017984 277 411 525 479 0.0013674917863681912
|
||||
00017984 157 414 413 476 0.0013192225014790893
|
||||
00017984 277 190 505 297 0.001269816653802991
|
||||
00017984 47 7 215 58 0.0011716332519426942
|
||||
00017984 355 421 478 477 0.0011690118117257953
|
||||
00017984 255 419 372 473 0.0011173418024554849
|
||||
00017984 89 239 352 378 0.0011126784374937415
|
||||
00017984 319 132 510 213 0.001100254012271762
|
||||
00017984 434 79 545 124 0.0010360201122239232
|
||||
00017984 16 160 240 326 0.001034620450809598
|
||||
00017984 408 200 576 286 0.0010141994571313262
|
||||
00017984 529 83 630 128 0.0010060722706839442
|
||||
00017984 170 76 302 139 0.0009955894201993942
|
||||
00017984 77 192 460 406 0.0009637664188630879
|
||||
00017984 453 425 568 477 0.0009482947061769664
|
||||
00017984 65 0 377 226 0.0008330706623382866
|
||||
00017984 545 353 637 409 0.0007769505609758198
|
||||
00017984 77 249 617 480 0.0007756722043268383
|
||||
00017984 57 80 190 120 0.000709329207893461
|
||||
00017984 289 68 505 231 0.0006693153991363943
|
||||
00017984 29 77 244 236 0.0006519559537991881
|
||||
00017984 171 353 271 404 0.0006353610660880804
|
||||
00017984 347 342 486 480 0.0005356252659112215
|
||||
00017984 168 388 634 480 0.0005155978142283857
|
||||
00017984 253 339 377 480 0.0005088666221126914
|
||||
00017984 173 149 291 196 0.000496460881549865
|
||||
00017984 222 297 395 444 0.0004891842254437506
|
||||
00017984 207 12 607 175 0.0004602100816555321
|
||||
00017984 258 340 348 410 0.0004121677775401622
|
||||
00017984 116 55 350 144 0.00039320881478488445
|
||||
00017984 361 341 447 413 0.0003922795585822314
|
||||
00017984 366 172 604 310 0.0003749817842617631
|
||||
00017984 0 249 163 368 0.0003390935598872602
|
||||
00017984 139 330 295 415 0.0003272908797953278
|
||||
00017984 144 151 362 355 0.00029974692733958364
|
||||
00017984 339 295 630 480 0.0002550742938183248
|
||||
00017984 225 155 460 325 0.0002539839188102633
|
||||
00017984 0 109 151 217 0.00022946164244785905
|
||||
00017984 21 356 522 480 0.0002136928669642657
|
||||
00017984 449 337 557 420 0.00021203125652391464
|
||||
00017984 382 118 622 227 0.00013031855633016676
|
||||
00017984 146 113 384 236 0.00011765705130528659
|
||||
00018573 319 110 450 244 0.9897462129592896
|
||||
00018573 90 102 229 234 0.9283090233802795
|
||||
00018573 79 87 224 401 0.4545566439628601
|
||||
00018573 43 49 218 211 0.3753353953361511
|
||||
00018573 287 65 428 219 0.37207674980163574
|
||||
00018573 71 133 180 227 0.3257155120372772
|
||||
00018573 103 393 522 500 0.2447475790977478
|
||||
00018573 348 144 452 216 0.24418456852436066
|
||||
00018573 136 106 389 230 0.2402806282043457
|
||||
00018573 268 86 486 274 0.22362710535526276
|
||||
00018573 8 117 98 226 0.19536162912845612
|
||||
00018573 213 120 311 219 0.14684827625751495
|
||||
00018573 59 71 169 177 0.1411411315202713
|
||||
00018573 353 66 451 194 0.1284961998462677
|
||||
00018573 2 68 83 170 0.09691505879163742
|
||||
00018573 188 30 323 232 0.0784328430891037
|
||||
00018573 340 148 462 296 0.06238303706049919
|
||||
00018573 141 438 431 503 0.05915208160877228
|
||||
00018573 120 147 226 215 0.057493019849061966
|
||||
00018573 127 63 220 198 0.04484178498387337
|
||||
00018573 229 369 509 472 0.044580694288015366
|
||||
00018573 37 62 290 295 0.0383601188659668
|
||||
00018573 0 67 90 352 0.03603912144899368
|
||||
00018573 0 122 210 217 0.032230257987976074
|
||||
00018573 259 428 488 503 0.0305311419069767
|
||||
00018573 292 125 438 344 0.026789184659719467
|
||||
00018573 2 16 254 444 0.02605234831571579
|
||||
00018573 94 0 253 247 0.019378909841179848
|
||||
00018573 261 259 494 512 0.01737048663198948
|
||||
00018573 57 84 158 134 0.017106175422668457
|
||||
00018573 2 8 346 224 0.016886768862605095
|
||||
00018573 425 115 518 248 0.016800038516521454
|
||||
00018573 56 121 192 312 0.014590417966246605
|
||||
00018573 325 375 492 438 0.01327232550829649
|
||||
00018573 110 138 233 306 0.012144745327532291
|
||||
00018573 338 0 469 216 0.012041065841913223
|
||||
00018573 411 440 507 500 0.011774958111345768
|
||||
00018573 326 216 473 288 0.011646736413240433
|
||||
00018573 0 31 111 224 0.011095283553004265
|
||||
00018573 181 451 339 502 0.009249952621757984
|
||||
00018573 303 78 392 158 0.009181584231555462
|
||||
00018573 360 69 519 298 0.008503065444529057
|
||||
00018573 187 123 515 393 0.007812915369868279
|
||||
00018573 419 91 515 394 0.007111456245183945
|
||||
00018573 39 95 370 504 0.007102791219949722
|
||||
00018573 232 51 307 185 0.0070172823034226894
|
||||
00018573 352 81 446 141 0.006858893670141697
|
||||
00018573 33 154 188 493 0.006417808122932911
|
||||
00018573 13 79 115 489 0.005871733650565147
|
||||
00018573 179 378 408 443 0.005770611576735973
|
||||
00018573 399 2 521 235 0.005407017655670643
|
||||
00018573 151 37 499 222 0.00539295794442296
|
||||
00018573 285 179 414 299 0.0051244585774838924
|
||||
00018573 41 220 194 280 0.0051088291220366955
|
||||
00018573 353 0 461 96 0.004971992690116167
|
||||
00018573 21 175 256 289 0.004446413833647966
|
||||
00018573 358 212 466 411 0.0040200259536504745
|
||||
00018573 214 386 340 436 0.004018367268145084
|
||||
00018573 272 0 398 193 0.004015874117612839
|
||||
00018573 118 222 231 284 0.003910831641405821
|
||||
00018573 105 46 404 329 0.003624335862696171
|
||||
00018573 279 20 522 503 0.00339940725825727
|
||||
00018573 276 382 397 428 0.003176348051056266
|
||||
00018573 339 338 489 479 0.0030564111657440662
|
||||
00018573 0 223 94 277 0.0029446613043546677
|
||||
00018573 284 236 400 278 0.002469860715791583
|
||||
00018573 347 450 475 498 0.002156781265512109
|
||||
00018573 16 152 447 365 0.002094767289236188
|
||||
00018573 432 0 522 84 0.0019603644032031298
|
||||
00018573 129 83 214 142 0.0018060017609968781
|
||||
00018573 433 155 512 210 0.001754443976096809
|
||||
00018573 30 301 477 512 0.0015794619685038924
|
||||
00018573 384 411 497 508 0.0015135450521484017
|
||||
00018573 54 10 178 66 0.0014640988083556294
|
||||
00018573 207 0 310 151 0.0014184099854901433
|
||||
00018573 20 444 251 511 0.0012729985173791647
|
||||
00018573 285 0 389 104 0.0012238421477377415
|
||||
00018573 129 159 244 420 0.0011796436738222837
|
||||
00018573 293 192 409 412 0.0010717087425291538
|
||||
00018573 435 163 519 304 0.0009974032873287797
|
||||
00018573 64 412 359 511 0.0009544852655380964
|
||||
00018573 49 297 170 490 0.0009427929180674255
|
||||
00018573 0 167 106 291 0.0008830682490952313
|
||||
00018573 125 451 274 503 0.0008813723106868565
|
||||
00018573 278 0 520 97 0.0008789845742285252
|
||||
00018573 205 224 308 282 0.0008723472128622234
|
||||
00018573 11 0 221 158 0.000871601514518261
|
||||
00018573 421 291 522 510 0.0008698318270035088
|
||||
00018573 427 225 522 279 0.0008524131262674928
|
||||
00018573 413 380 522 440 0.0007958997739478946
|
||||
00018573 224 1 306 77 0.0007714590174145997
|
||||
00018573 0 459 94 503 0.0007581215468235314
|
||||
00018573 73 363 368 471 0.0006139951292425394
|
||||
00018573 6 214 87 444 0.0006080020684748888
|
||||
00018573 272 450 409 500 0.0006064313347451389
|
||||
00018573 358 295 456 369 0.0006049877847544849
|
||||
00018573 217 192 325 427 0.0005285342922434211
|
||||
00018573 227 85 304 141 0.0005183502216823399
|
||||
00018573 205 70 348 171 0.0005180046427994967
|
||||
00018573 203 154 316 316 0.0005172021919861436
|
||||
00018573 0 16 105 59 0.0004934542230330408
|
||||
00018573 432 222 522 432 0.00048021049587987363
|
||||
00018573 145 381 244 443 0.0004673106886912137
|
||||
00018573 131 0 233 160 0.00045855832286179066
|
||||
00018573 216 270 310 392 0.0004489491693675518
|
||||
00018573 166 171 390 454 0.0004233682411722839
|
||||
00018573 123 190 431 299 0.0004197377129457891
|
||||
00018573 50 454 183 504 0.0004125136765651405
|
||||
00018573 13 224 261 423 0.00038468558341264725
|
||||
00018573 169 1 363 80 0.0003753843775484711
|
||||
00018573 61 225 169 400 0.0003697050560731441
|
||||
00018573 194 385 342 512 0.00035893486347049475
|
||||
00018573 442 43 522 191 0.0003199915518052876
|
||||
00018573 137 5 232 74 0.0003163672226946801
|
||||
00018573 173 106 332 371 0.0003013779642060399
|
||||
00018573 184 323 386 496 0.0002842953254003078
|
||||
00018573 8 332 264 497 0.0002603182219900191
|
||||
00018573 276 378 423 512 0.00025999819627031684
|
||||
00018573 290 280 402 385 0.000249253906076774
|
||||
00018573 52 2 270 81 0.0002486195007804781
|
||||
00018573 2 14 162 95 0.000207726945518516
|
||||
00018573 210 274 469 401 0.00019459314353298396
|
||||
00018573 106 0 430 109 0.00019169341248925775
|
||||
00018573 134 255 232 392 0.00018858499242924154
|
||||
00018573 59 376 161 447 0.0001838515163399279
|
||||
00018573 297 311 387 358 0.0001550256711198017
|
||||
00018573 131 318 257 479 0.0001470775023335591
|
||||
00018573 314 253 522 417 0.00014644552720710635
|
||||
00018573 12 314 85 501 0.0001262789883185178
|
||||
00018573 224 307 315 358 0.00011264947534073144
|
||||
00018573 62 298 178 364 0.00011231343523832038
|
||||
00018573 0 0 167 317 0.00010820152965607122
|
||||
00018573 62 267 332 393 0.00010355013364460319
|
||||
00032564 87 59 215 390 0.9970299005508423
|
||||
00032564 23 62 164 385 0.26364627480506897
|
||||
00032564 99 50 207 238 0.25082671642303467
|
||||
00032564 13 27 289 420 0.0916571095585823
|
||||
00032564 53 35 724 462 0.08701056987047195
|
||||
00032564 123 20 344 315 0.011361612938344479
|
||||
00032564 416 230 559 284 0.009997757151722908
|
||||
00032564 98 167 228 337 0.008734875358641148
|
||||
00032564 98 236 219 384 0.008023219183087349
|
||||
00032564 372 127 761 512 0.00781198451295495
|
||||
00032564 118 66 206 165 0.007677215617150068
|
||||
00032564 19 87 131 271 0.007462808396667242
|
||||
00032564 31 397 739 512 0.007216962520033121
|
||||
00032564 436 146 531 221 0.005844444502145052
|
||||
00032564 12 158 130 347 0.005281529389321804
|
||||
00032564 195 72 307 282 0.004632377531379461
|
||||
00032564 346 147 436 237 0.003867375198751688
|
||||
00032564 442 178 581 330 0.00384037964977324
|
||||
00032564 55 95 238 268 0.003470006166025996
|
||||
00032564 446 85 537 128 0.0033686659298837185
|
||||
00032564 190 136 333 340 0.0033482061699032784
|
||||
00032564 447 115 562 264 0.0032745026983320713
|
||||
00032564 0 133 485 359 0.0031289865728467703
|
||||
00032564 324 202 471 321 0.0027138893492519855
|
||||
00032564 203 128 307 229 0.0021317931823432446
|
||||
00032564 546 81 640 133 0.0021200922783464193
|
||||
00032564 137 265 736 483 0.002109762281179428
|
||||
00032564 368 112 452 265 0.0020976278465241194
|
||||
00032564 543 25 661 178 0.0017771999118849635
|
||||
00032564 27 45 139 196 0.0016729205381125212
|
||||
00032564 187 14 664 313 0.0015246121911332011
|
||||
00032564 329 233 466 282 0.0014214653056114912
|
||||
00032564 219 109 586 501 0.0014111793134361506
|
||||
00032564 384 224 640 295 0.0013912779977545142
|
||||
00032564 0 22 500 276 0.0013232897035777569
|
||||
00032564 100 148 209 206 0.0013111219741404057
|
||||
00032564 201 193 317 301 0.0012872613733634353
|
||||
00032564 631 458 744 504 0.0012433662777766585
|
||||
00032564 328 163 399 198 0.0012145760701969266
|
||||
00032564 658 22 757 178 0.0011336510069668293
|
||||
00032564 45 150 254 504 0.00111566879786551
|
||||
00032564 655 142 770 505 0.0010633376659825444
|
||||
00032564 431 56 529 135 0.0010132075985893607
|
||||
00032564 85 379 238 441 0.0010107355192303658
|
||||
00032564 407 110 630 397 0.0009370078914798796
|
||||
00032564 529 227 676 286 0.0009267269051633775
|
||||
00032564 421 301 566 360 0.000832569960039109
|
||||
00032564 661 44 725 148 0.0007897102041170001
|
||||
00032564 343 134 491 393 0.0007532132440246642
|
||||
00032564 296 300 446 363 0.0007341417949646711
|
||||
00032564 346 50 415 307 0.0007213400676846504
|
||||
00032564 418 211 585 428 0.0007024178048595786
|
||||
00032564 305 254 460 385 0.0006743855192326009
|
||||
00032564 635 79 722 136 0.0006542549817822874
|
||||
00032564 126 130 358 428 0.0005980688147246838
|
||||
00032564 195 158 293 197 0.0005854472983628511
|
||||
00032564 293 197 702 326 0.0005834837211295962
|
||||
00032564 545 154 651 210 0.0005717547610402107
|
||||
00032564 182 450 592 512 0.0005654341075569391
|
||||
00032564 329 88 448 134 0.0005609166109934449
|
||||
00032564 658 329 770 469 0.0005522951250895858
|
||||
00032564 655 425 766 504 0.00054553133668378
|
||||
00032564 446 33 550 166 0.0005345381796360016
|
||||
00032564 647 372 760 435 0.0005295398295857012
|
||||
00032564 3 190 196 416 0.000515947409439832
|
||||
00032564 108 306 219 362 0.0005089023034088314
|
||||
00032564 646 151 720 204 0.0004967362037859857
|
||||
00032564 502 37 625 150 0.00048782670637592673
|
||||
00032564 190 234 287 276 0.0004749493673443794
|
||||
00032564 71 61 275 176 0.0004699462733697146
|
||||
00032564 451 0 670 263 0.0004676413373090327
|
||||
00032564 63 173 375 321 0.00046215864131227136
|
||||
00032564 324 431 770 512 0.00045980376307852566
|
||||
00032564 8 143 125 218 0.00045729518751613796
|
||||
00032564 546 102 663 261 0.00043780243140645325
|
||||
00032564 5 218 127 292 0.000426046404754743
|
||||
00032564 16 249 147 381 0.00040254584746435285
|
||||
00032564 104 229 215 287 0.0004011912096757442
|
||||
00032564 508 448 717 510 0.000397819239879027
|
||||
00032564 295 463 463 503 0.00038894236786291003
|
||||
00032564 420 385 555 422 0.00038203923031687737
|
||||
00032564 268 186 506 442 0.00037836332921870053
|
||||
00032564 182 220 346 395 0.00037603138480335474
|
||||
00032564 318 384 468 424 0.00036403941339813173
|
||||
00032564 204 300 336 367 0.0003511334944050759
|
||||
00032564 282 156 441 217 0.0003370631893631071
|
||||
00032564 33 363 293 472 0.00032610856578685343
|
||||
00032564 668 127 729 202 0.0003255174378864467
|
||||
00032564 475 258 729 512 0.00032254966208711267
|
||||
00032564 0 16 88 59 0.00031814086833037436
|
||||
00032564 409 459 573 502 0.00030859277467243373
|
||||
00032564 366 254 621 494 0.0002852455945685506
|
||||
00032564 666 96 754 247 0.0002839291119016707
|
||||
00032564 292 80 469 259 0.00028375457623042166
|
||||
00032564 145 151 288 209 0.0002729874977376312
|
||||
00032564 653 252 770 394 0.0002715993905439973
|
||||
00032564 313 15 441 54 0.0002689342654775828
|
||||
00032564 400 153 619 219 0.00025347518385387957
|
||||
00032564 638 295 767 356 0.0002461145631968975
|
||||
00032564 319 57 447 163 0.00024403704446740448
|
||||
00032564 524 173 688 336 0.00023362674983218312
|
||||
00032564 206 56 332 172 0.0002189571678172797
|
||||
00032564 434 15 534 57 0.0002188477956224233
|
||||
00032564 625 238 746 278 0.00021711339650209993
|
||||
00032564 0 394 361 512 0.00020605060853995383
|
||||
00032564 656 16 769 77 0.00019652863556984812
|
||||
00032564 532 300 685 360 0.0001937610941240564
|
||||
00032564 267 354 692 460 0.00019373191753402352
|
||||
00032564 186 463 371 503 0.000192962063010782
|
||||
00032564 6 215 584 425 0.00018357826047576964
|
||||
00032564 413 356 555 449 0.00018246070249006152
|
||||
00032564 155 115 359 235 0.00017860053048934788
|
||||
00032564 193 281 616 384 0.0001722056622384116
|
||||
00032564 378 0 770 350 0.00017156190006062388
|
||||
00032564 183 322 555 496 0.00016361191228497773
|
||||
00032564 531 376 682 438 0.0001626279845368117
|
||||
00032564 23 260 330 388 0.00015872351650614291
|
||||
00032564 214 84 333 137 0.00014699225721415132
|
||||
00032564 372 292 652 367 0.00014495261711999774
|
||||
00032564 1 371 154 434 0.00013407117512542754
|
||||
00032564 396 427 587 512 0.00013374023546930403
|
||||
00032564 254 374 535 442 0.0001306784397456795
|
||||
00032564 394 44 580 123 0.00012277862697374076
|
||||
00032564 533 11 701 66 0.00012054431135766208
|
||||
00032564 490 342 714 468 0.00011813630408141762
|
||||
00032564 502 124 643 228 0.00011395861656637862
|
||||
00032564 649 204 770 282 0.00011071289918618277
|
||||
00032564 527 233 703 411 0.00010990674491040409
|
||||
00032564 0 36 241 200 0.00010878648026846349
|
||||
00032564 7 308 150 361 0.0001055368993547745
|
||||
00032564 0 280 155 486 0.00010524936078581959
|
||||
00032564 18 81 140 138 0.0001024300727294758
|
||||
00032564 417 0 747 66 0.00010104414832312614
|
||||
00035635 105 94 374 694 0.9997064471244812
|
||||
00035635 162 116 349 504 0.029531387612223625
|
||||
00035635 115 134 281 440 0.020277176052331924
|
||||
00035635 113 233 262 661 0.017007218673825264
|
||||
00035635 423 117 512 638 0.012933779507875443
|
||||
00035635 251 136 380 619 0.01204749010503292
|
||||
00035635 56 422 174 577 0.010531827807426453
|
||||
00035635 115 192 245 347 0.008671603165566921
|
||||
00035635 5 501 221 756 0.00672384537756443
|
||||
00035635 189 265 327 654 0.0065661147236824036
|
||||
00035635 200 514 316 698 0.0050666071474552155
|
||||
00035635 32 402 213 627 0.004788365680724382
|
||||
00035635 64 352 317 715 0.004783510230481625
|
||||
00035635 97 446 259 701 0.004216741770505905
|
||||
00035635 260 91 376 307 0.003701842622831464
|
||||
00035635 109 396 290 608 0.0034999342169612646
|
||||
00035635 344 272 449 510 0.0033990778028964996
|
||||
00035635 0 633 279 768 0.0032744701020419598
|
||||
00035635 423 360 505 592 0.002836190164089203
|
||||
00035635 190 86 331 280 0.0027417512610554695
|
||||
00035635 297 111 460 623 0.002378646284341812
|
||||
00035635 128 236 238 315 0.0019606042187660933
|
||||
00035635 204 146 323 362 0.0019473455613479018
|
||||
00035635 23 95 254 651 0.0017580452840775251
|
||||
00035635 272 371 380 615 0.0015840621199458838
|
||||
00035635 0 468 109 768 0.001275054644793272
|
||||
00035635 0 670 105 759 0.0012715993216261268
|
||||
00035635 178 423 338 600 0.0010581344831734896
|
||||
00035635 433 289 504 497 0.0010389654198661447
|
||||
00035635 350 396 458 584 0.0009849437046796083
|
||||
00035635 48 218 182 330 0.0009708252036944032
|
||||
00035635 412 671 512 755 0.0008861586102284491
|
||||
00035635 115 84 271 273 0.0008384454413317144
|
||||
00035635 52 206 175 564 0.0007300805300474167
|
||||
00035635 116 444 262 560 0.0006994891446083784
|
||||
00035635 109 547 251 659 0.0006538451998494565
|
||||
00035635 280 246 377 522 0.0006502107717096806
|
||||
00035635 32 519 177 684 0.0006300053792074323
|
||||
00035635 356 331 442 440 0.0005845251143909991
|
||||
00035635 129 284 237 508 0.0005117427790537477
|
||||
00035635 60 277 160 471 0.0005114825908094645
|
||||
00035635 270 206 375 331 0.00048127619083970785
|
||||
00035635 44 152 229 351 0.00047699446440674365
|
||||
00035635 132 339 425 646 0.0004545162955764681
|
||||
00035635 23 669 189 761 0.00045146659249439836
|
||||
00035635 47 231 334 536 0.0003717626677826047
|
||||
00035635 365 429 511 557 0.0003406273608561605
|
||||
00035635 304 652 512 768 0.0003139482287224382
|
||||
00035635 207 555 303 642 0.0002988954074680805
|
||||
00035635 415 401 512 733 0.0002865834394469857
|
||||
00035635 206 237 312 320 0.0002680493053048849
|
||||
00035635 340 119 444 446 0.00025423202896490693
|
||||
00035635 277 449 379 559 0.00024970012600533664
|
||||
00035635 280 338 371 434 0.0002345809480175376
|
||||
00035635 0 23 157 737 0.0002314470912097022
|
||||
00035635 140 653 340 768 0.00022031478874851018
|
||||
00035635 352 458 440 540 0.0002125000028172508
|
||||
00035635 166 313 335 467 0.0002062947751255706
|
||||
00035635 423 452 499 541 0.00020343433425296098
|
||||
00035635 443 0 512 443 0.00020288460655137897
|
||||
00035635 31 0 226 435 0.00019246978627052158
|
||||
00035635 368 333 512 633 0.00019027013331651688
|
||||
00035635 87 53 348 378 0.00018567664665170014
|
||||
00035635 127 338 268 450 0.00018149284005630761
|
||||
00035635 42 333 160 424 0.00017923378618434072
|
||||
00035635 195 247 477 511 0.00015656722825951874
|
||||
00035635 112 671 253 765 0.00015264384273905307
|
||||
00035635 207 453 302 542 0.00015120966418180615
|
||||
00035635 344 62 442 280 0.00014004811237100512
|
||||
00035635 0 441 417 768 0.00013604489504359663
|
||||
00035635 133 120 241 236 0.00012094359408365563
|
||||
00035635 0 0 99 495 0.00011243269545957446
|
||||
00035635 0 552 107 667 0.00010408610251033679
|
||||
00035635 209 109 328 205 0.00010359201405663043
|
||||
00035635 0 412 105 574 0.00010155184281757101
|
||||
00049736 5 60 357 488 0.9960564374923706
|
||||
00049736 162 68 446 505 0.6719235777854919
|
||||
00049736 0 73 151 489 0.3681921660900116
|
||||
00049736 294 149 447 505 0.31004464626312256
|
||||
00049736 59 70 265 370 0.054970815777778625
|
||||
00049736 16 239 295 512 0.051978111267089844
|
||||
00049736 0 30 156 231 0.049275580793619156
|
||||
00049736 199 241 374 512 0.038529664278030396
|
||||
00049736 188 78 359 322 0.03765743598341942
|
||||
00049736 0 310 133 512 0.02319936826825142
|
||||
00049736 58 36 243 204 0.01730644330382347
|
||||
00049736 635 333 768 497 0.016376622021198273
|
||||
00049736 33 384 274 512 0.012192524038255215
|
||||
00049736 309 245 435 421 0.008943583816289902
|
||||
00049736 4 5 130 96 0.008081500418484211
|
||||
00049736 626 406 752 511 0.0079392334446311
|
||||
00049736 408 217 548 303 0.007434685714542866
|
||||
00049736 295 93 446 327 0.006321291904896498
|
||||
00049736 199 42 356 210 0.005443563684821129
|
||||
00049736 85 0 245 93 0.005272073205560446
|
||||
00049736 0 158 118 343 0.00520692951977253
|
||||
00049736 640 0 730 66 0.005100768990814686
|
||||
00049736 302 324 451 490 0.004670242313295603
|
||||
00049736 59 353 242 468 0.004144612234085798
|
||||
00049736 31 5 768 512 0.00392926437780261
|
||||
00049736 18 403 151 509 0.0037611338775604963
|
||||
00049736 78 205 251 449 0.003475954057648778
|
||||
00049736 403 251 562 425 0.003344107884913683
|
||||
00049736 91 295 465 512 0.003202399704605341
|
||||
00049736 182 380 366 512 0.003090837737545371
|
||||
00049736 6 239 121 427 0.002794140251353383
|
||||
00049736 209 0 346 95 0.0027575697749853134
|
||||
00049736 83 107 238 236 0.0027025239542126656
|
||||
00049736 11 3 348 283 0.0022753735538572073
|
||||
00049736 647 363 766 442 0.0020165028981864452
|
||||
00049736 321 194 444 313 0.0017973019275814295
|
||||
00049736 393 305 551 493 0.001757959951646626
|
||||
00049736 317 291 442 355 0.0015206626849249005
|
||||
00049736 308 7 443 66 0.0014347851974889636
|
||||
00049736 389 167 560 351 0.0014336461899802089
|
||||
00049736 32 0 312 142 0.0014267273945733905
|
||||
00049736 632 0 758 179 0.0012978059239685535
|
||||
00049736 259 82 598 501 0.0012594008585438132
|
||||
00049736 291 407 461 512 0.0012341917026787996
|
||||
00049736 416 294 557 365 0.001195562188513577
|
||||
00049736 392 144 575 236 0.001180910738185048
|
||||
00049736 206 264 356 403 0.001093524624593556
|
||||
00049736 137 101 408 246 0.0010163452243432403
|
||||
00049736 125 231 441 438 0.0009884013561531901
|
||||
00049736 83 176 234 317 0.0009568653767928481
|
||||
00049736 5 365 131 451 0.0009261324303224683
|
||||
00049736 308 202 630 313 0.0008603077731095254
|
||||
00049736 185 354 402 461 0.0008436915813945234
|
||||
00049736 201 142 339 226 0.0008303183712996542
|
||||
00049736 452 416 737 512 0.0007777310092933476
|
||||
00049736 210 193 356 311 0.0007423642091453075
|
||||
00049736 9 61 139 156 0.0007366120698861778
|
||||
00049736 5 138 119 220 0.0007306770421564579
|
||||
00049736 255 323 617 495 0.000693094334565103
|
||||
00049736 404 422 579 512 0.000673351576551795
|
||||
00049736 525 6 677 60 0.0006362493732012808
|
||||
00049736 243 2 558 77 0.0006083156331442297
|
||||
00049736 626 169 768 486 0.0005766884423792362
|
||||
00049736 86 66 224 158 0.0005534703377634287
|
||||
00049736 279 258 621 435 0.0005424958653748035
|
||||
00049736 177 419 559 512 0.0005314233130775392
|
||||
00049736 58 281 254 385 0.0005172271048650146
|
||||
00049736 0 216 113 294 0.0004919166094623506
|
||||
00049736 84 374 233 429 0.00048600794980302453
|
||||
00049736 162 11 379 140 0.0004730106156785041
|
||||
00049736 294 41 461 224 0.0004689077031798661
|
||||
00049736 318 143 448 224 0.0004450618289411068
|
||||
00049736 531 225 683 297 0.00041610634070821106
|
||||
00049736 15 170 333 329 0.000389123015338555
|
||||
00049736 358 104 599 263 0.00038782309275120497
|
||||
00049736 308 228 425 281 0.0003832030051853508
|
||||
00049736 425 0 739 71 0.00037614646134898067
|
||||
00049736 17 120 500 365 0.00037287009763531387
|
||||
00049736 201 171 675 347 0.00035750397364608943
|
||||
00049736 291 5 466 126 0.0003379762056283653
|
||||
00049736 510 297 698 500 0.00030197997693903744
|
||||
00049736 1 291 120 367 0.0003019428113475442
|
||||
00049736 423 54 582 171 0.0002952874347101897
|
||||
00049736 227 69 339 162 0.00029319082386791706
|
||||
00049736 446 17 768 470 0.00028081220807507634
|
||||
00049736 204 301 335 353 0.0002780314825940877
|
||||
00049736 97 155 224 212 0.0002647485234774649
|
||||
00049736 215 99 747 266 0.0002605488698463887
|
||||
00049736 206 376 344 432 0.0002577457926236093
|
||||
00049736 76 445 244 505 0.0002510900376364589
|
||||
00049736 204 446 363 505 0.00023869663709774613
|
||||
00049736 103 2 464 103 0.00022333009110298008
|
||||
00049736 284 364 470 445 0.0002196197456214577
|
||||
00049736 206 230 330 282 0.00020889802544843405
|
||||
00049736 620 70 741 132 0.00020067479636054486
|
||||
00049736 535 11 708 200 0.00018031505169346929
|
||||
00049736 92 231 224 282 0.00017632618255447596
|
||||
00049736 520 449 693 506 0.00017475367349106818
|
||||
00049736 517 176 705 349 0.00015294659533537924
|
||||
00049736 526 345 673 460 0.0001499950885772705
|
||||
00049736 525 299 700 368 0.00014876158093102276
|
||||
00049736 539 49 670 157 0.00014690229727420956
|
||||
00049736 639 184 768 326 0.0001433542784070596
|
||||
00049736 88 302 234 356 0.0001413424761267379
|
||||
00049736 606 0 756 341 0.00012745802814606577
|
||||
00049736 417 367 555 440 0.00011021708633052185
|
||||
00049736 378 22 625 212 0.00010244589793728665
|
||||
15
mmp/a6/nms.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from typing import List, Sequence, Tuple
|
||||
|
||||
from ..a3.annotation import AnnotationRect
|
||||
|
||||
|
||||
def non_maximum_suppression(
|
||||
boxes_scores: Sequence[Tuple[AnnotationRect, float]], threshold: float
|
||||
) -> List[Tuple[AnnotationRect, float]]:
|
||||
"""Exercise 6.1
|
||||
@param boxes_scores: Sequence of tuples of annotations and scores
|
||||
@param threshold: Threshold for NMS
|
||||
|
||||
@return: A list of tuples of the remaining boxes after NMS together with their scores
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
2
mmp/a7/dataset.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# copy your dataset.py code from assignment 6 here
|
||||
# everything that you want points for has to be in this folder
|
||||
7
mmp/a7/main.py
Normal file
@@ -0,0 +1,7 @@
|
||||
def main():
|
||||
"""Put the surrounding training code here. The code will probably look very similar to last assignment"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
26
mmp/a8/bbr.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import torch
|
||||
import numpy as np
|
||||
|
||||
from ..a3.annotation import AnnotationRect
|
||||
|
||||
|
||||
def get_bbr_loss(
|
||||
anchor_boxes: torch.Tensor,
|
||||
adjustments: torch.Tensor,
|
||||
groundtruths: torch.Tensor,
|
||||
):
|
||||
"""
|
||||
@param anchor_boxes: Batch of box coordinates from the anchor grid
|
||||
@param adjustments: Batch of adjustments of the prediction (#data, 4)
|
||||
@param groundtruths: Batch of ground truth data given as (x1, y1, x2, y2) (#data, 4)
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def apply_bbr(anchor_box: np.ndarray, adjustment: torch.Tensor) -> AnnotationRect:
|
||||
"""Calculates an AnnotationRect based on a given anchor box and adjustments
|
||||
|
||||
@param anchor_box: Single box coordinates from the anchor grid
|
||||
@param adjustment: Adjustments, generated by the model
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
9
requirements.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
# these are the python packages that are used for testing
|
||||
# if you use other packages, you might loose points
|
||||
matplotlib==3.8.4
|
||||
numpy==1.26.4
|
||||
pillow==10.3.0
|
||||
pytest==8.1.1
|
||||
torch==2.2.2
|
||||
torchvision==0.17.2
|
||||
tqdm==4.66.2
|
||||
52
tests/__init__.py
Normal file
@@ -0,0 +1,52 @@
|
||||
import ast
|
||||
from pathlib import Path
|
||||
|
||||
MMP_PARENTS = ["mmp"] + [f"a{i}" for i in range(1, 9)]
|
||||
MMP_LOCAL_MODULES = [
|
||||
"anchor_grid",
|
||||
"annotation",
|
||||
"bbr",
|
||||
"dataset",
|
||||
"evallib",
|
||||
"label_grid",
|
||||
"main",
|
||||
"model",
|
||||
"nms",
|
||||
]
|
||||
|
||||
|
||||
def check_bad_imports(file_path: Path | list[Path]):
|
||||
if not isinstance(file_path, list):
|
||||
file_path = [file_path]
|
||||
bad_imports = []
|
||||
|
||||
for path in file_path:
|
||||
with open(path, "r") as file:
|
||||
tree = ast.parse(file.read(), filename=path)
|
||||
|
||||
absolute_imports = set()
|
||||
for node in ast.walk(tree):
|
||||
if isinstance(node, ast.Import):
|
||||
for n in node.names:
|
||||
for req in MMP_PARENTS:
|
||||
if req in n.name:
|
||||
absolute_imports.add(n.lineno)
|
||||
for req in MMP_LOCAL_MODULES:
|
||||
if req == n.name:
|
||||
absolute_imports.add(n.lineno)
|
||||
if isinstance(node, ast.ImportFrom):
|
||||
if node.level == 0:
|
||||
for req in MMP_PARENTS:
|
||||
if req in node.module:
|
||||
absolute_imports.add(node.lineno)
|
||||
for req in MMP_LOCAL_MODULES:
|
||||
if req == node.module:
|
||||
absolute_imports.add(node.lineno)
|
||||
if len(absolute_imports) > 0:
|
||||
bad_imports.append((path, sorted(absolute_imports)))
|
||||
if len(bad_imports) != 0:
|
||||
message = "\n There are absolute imports in the following files:\n"
|
||||
for path, line_numbers in bad_imports:
|
||||
message += f"{path}: {', '.join(str(num) for num in line_numbers)}\n"
|
||||
assert len(bad_imports) == 0, message
|
||||
|
||||
62
tests/test_a1.py
Normal file
@@ -0,0 +1,62 @@
|
||||
from datetime import datetime
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
from tempfile import TemporaryDirectory
|
||||
import numpy as np
|
||||
from PIL import Image
|
||||
import torch
|
||||
import torchvision
|
||||
|
||||
from . import check_bad_imports
|
||||
from mmp.a1 import main, tensors
|
||||
|
||||
current_assignment = pytest.mark.skipif(
|
||||
not (datetime.now() <= datetime(2025, 10, 22, 23, 59, 59)),
|
||||
reason="This is not the current assignment.",
|
||||
)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_no_abs_import():
|
||||
paths = list(Path().glob("mmp/a1/*.py"))
|
||||
check_bad_imports(paths)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_main():
|
||||
# for testing: generate random image
|
||||
img1 = Image.fromarray((np.random.rand(128, 128, 3) * 255).astype(np.uint8))
|
||||
img2 = Image.fromarray((np.random.rand(128, 128, 3) * 255).astype(np.uint8))
|
||||
tfm = torchvision.transforms.Resize(320)
|
||||
with TemporaryDirectory() as img_dir:
|
||||
img_dir = Path(img_dir)
|
||||
p1 = str(img_dir / "img1.jpg")
|
||||
p2 = str(img_dir / "img2.jpg")
|
||||
img1.save(p1)
|
||||
img2.save(p2)
|
||||
batch = main.build_batch([p1, p2])
|
||||
batch_transformed = main.build_batch([p1, p2], transform=tfm)
|
||||
assert isinstance(batch, torch.Tensor)
|
||||
assert len(batch) == 2
|
||||
|
||||
model = main.get_model()
|
||||
assert isinstance(model, torch.nn.Module)
|
||||
|
||||
main.main
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_tensors():
|
||||
avg = tensors.avg_color(torch.rand(3, 128, 128))
|
||||
assert isinstance(avg, torch.Tensor)
|
||||
assert len(avg) == 3
|
||||
|
||||
masked = tensors.mask(
|
||||
torch.rand(3, 128, 128), torch.rand(3, 128, 128), torch.rand(128, 128), 0.3
|
||||
)
|
||||
assert isinstance(masked, torch.Tensor)
|
||||
assert masked.shape == (3, 128, 128)
|
||||
|
||||
result = tensors.add_matrix_vector(torch.rand(3, 4), torch.rand(3))
|
||||
assert isinstance(result, torch.Tensor)
|
||||
assert result.shape == (3, 4)
|
||||
42
tests/test_a2.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from datetime import datetime
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
import torch
|
||||
import os
|
||||
|
||||
from . import check_bad_imports
|
||||
from mmp.a2 import main
|
||||
|
||||
current_assignment = pytest.mark.skipif(
|
||||
not (datetime(2025, 10, 23) <= datetime.now() <= datetime(2025, 10, 29, 23, 59, 59)),
|
||||
reason="This is not the current assignment.",
|
||||
)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_no_abs_import():
|
||||
paths = list(Path().glob("mmp/a2/*.py"))
|
||||
check_bad_imports(paths)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_main():
|
||||
assert issubclass(main.MmpNet, torch.nn.Module)
|
||||
net = main.MmpNet(12)
|
||||
assert isinstance(net(torch.rand(2, 3, 128, 128)), torch.Tensor)
|
||||
|
||||
loader = main.get_dataloader(
|
||||
is_train=False,
|
||||
data_root=os.path.join(os.environ["TORCH_HOME"], "datasets"),
|
||||
batch_size=2,
|
||||
num_workers=0,
|
||||
)
|
||||
x = next(iter(loader))
|
||||
crit, opt = main.get_criterion_optimizer(net)
|
||||
assert isinstance(
|
||||
crit(torch.rand(10, 4), (torch.rand(10) * 2).long()), torch.Tensor
|
||||
)
|
||||
assert isinstance(opt, torch.optim.Optimizer)
|
||||
main.train_epoch
|
||||
main.eval_epoch
|
||||
main.main
|
||||
49
tests/test_a3.py
Normal file
@@ -0,0 +1,49 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
import torch
|
||||
import pytest
|
||||
|
||||
from . import check_bad_imports
|
||||
|
||||
|
||||
current_assignment = pytest.mark.skipif(
|
||||
not (datetime(2025, 10, 30) <= datetime.now() <= datetime(2025, 11, 5, 23, 59, 59)),
|
||||
reason="This is not the current assignment.",
|
||||
)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_no_abs_import():
|
||||
paths = list(Path().glob("mmp/a3/*.py"))
|
||||
check_bad_imports(paths)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_dataset():
|
||||
from mmp.a3 import dataset
|
||||
|
||||
assert issubclass(dataset.MMP_Dataset, torch.utils.data.Dataset)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_annotation():
|
||||
from mmp.a3 import annotation
|
||||
|
||||
rect = annotation.AnnotationRect(x1=3, y1=2, x2=40, y2=50)
|
||||
assert rect.x1 == 3
|
||||
assert rect.y1 == 2
|
||||
assert rect.x2 == 40
|
||||
assert rect.y2 == 50
|
||||
rect = annotation.AnnotationRect(x1=3, y1=2, x2=40, y2=50)
|
||||
assert rect.x1 == 3
|
||||
assert rect.y1 == 2
|
||||
assert rect.x2 == 40
|
||||
assert rect.y2 == 50
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_main():
|
||||
from mmp.a3 import main
|
||||
|
||||
main.main
|
||||
53
tests/test_a4.py
Normal file
@@ -0,0 +1,53 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
|
||||
from . import check_bad_imports
|
||||
from mmp.a4 import anchor_grid, label_grid, dataset
|
||||
|
||||
current_assignment = pytest.mark.skipif(
|
||||
not (datetime(2025, 11, 6) <= datetime.now() <= datetime(2025, 11, 12, 23, 59, 59)),
|
||||
reason="This is not the current assignment.",
|
||||
)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_no_abs_import():
|
||||
paths = list(Path().glob("mmp/a4/*.py"))
|
||||
check_bad_imports(paths)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_anchor_grid():
|
||||
grid = anchor_grid.get_anchor_grid(
|
||||
num_rows=4,
|
||||
num_cols=5,
|
||||
scale_factor=12.0,
|
||||
anchor_widths=[30.0, 80.0],
|
||||
aspect_ratios=[0.5, 1.0],
|
||||
)
|
||||
assert grid.ndim == 5
|
||||
assert grid.shape[-1] == 4
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_iou():
|
||||
label_grid.iou
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_label_grid():
|
||||
lg, *_ = label_grid.get_label_grid(
|
||||
anchor_grid=anchor_grid.get_anchor_grid(2, 2, 10, [10.0], [1.0]),
|
||||
gts=[],
|
||||
min_iou=0.5,
|
||||
)
|
||||
assert lg.dtype == bool
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_dataset():
|
||||
dataset.MMP_Dataset
|
||||
dataset.calculate_max_coverage
|
||||
34
tests/test_a5.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from . import check_bad_imports
|
||||
from mmp.a5 import model, main
|
||||
|
||||
current_assignment = pytest.mark.skipif(
|
||||
not (datetime(2025, 11, 13) <= datetime.now() <= datetime(2025, 11, 26, 23, 59, 59)),
|
||||
reason="This is not the current assignment.",
|
||||
)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_no_abs_import():
|
||||
paths = list(Path().glob("mmp/a5/*.py"))
|
||||
check_bad_imports(paths)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_model():
|
||||
net = model.MmpNet(num_widths=4, num_aspect_ratios=2)
|
||||
assert isinstance(net, torch.nn.Module)
|
||||
output = net(torch.rand(2, 3, 224, 224))
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_main():
|
||||
main.get_random_sampling_mask
|
||||
main.main
|
||||
main.step
|
||||
32
tests/test_a6.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
|
||||
from . import check_bad_imports
|
||||
from mmp.a6 import nms, main
|
||||
|
||||
|
||||
current_assignment = pytest.mark.skipif(
|
||||
not (datetime(2025, 11, 27) <= datetime.now() <= datetime(2025, 12, 10, 23, 59, 59)),
|
||||
reason="This is not the current assignment.",
|
||||
)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_no_abs_import():
|
||||
paths = list(Path().glob("mmp/a6/*.py"))
|
||||
check_bad_imports(paths)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_nms():
|
||||
nms.non_maximum_suppression
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_main():
|
||||
main.evaluate_test
|
||||
main.evaluate
|
||||
main.batch_inference
|
||||
31
tests/test_a7.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
|
||||
from . import check_bad_imports
|
||||
from mmp.a7 import main, dataset
|
||||
|
||||
|
||||
current_assignment = pytest.mark.skipif(
|
||||
not (datetime(2025, 12, 11) <= datetime.now() <= datetime(2025, 12, 17, 23, 59, 59)),
|
||||
reason="This is not the current assignment.",
|
||||
)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_no_abs_import():
|
||||
paths = list(Path().glob("mmp/a7/*.py"))
|
||||
check_bad_imports(paths)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_main():
|
||||
main.main
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_dataset():
|
||||
dataset.MMP_Dataset
|
||||
dataset.get_dataloader
|
||||
36
tests/test_a8.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from . import check_bad_imports
|
||||
from mmp.a8 import bbr
|
||||
|
||||
|
||||
current_assignment = pytest.mark.skipif(
|
||||
not (datetime(2025, 12, 18) <= datetime.now()),
|
||||
reason="This is not the current assignment.",
|
||||
)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_no_abs_import():
|
||||
paths = list(Path().glob("mmp/a8/*.py"))
|
||||
check_bad_imports(paths)
|
||||
|
||||
|
||||
@current_assignment
|
||||
def test_bbr():
|
||||
anchor_boxes = torch.tensor([10, 100, 10, 100]).unsqueeze(0)
|
||||
adjustments = torch.tensor([0.2, 0.2, 0.2, 0.2]).unsqueeze(0)
|
||||
groundtruths = torch.tensor([20, 100, 20, 90]).unsqueeze(0)
|
||||
loss = bbr.get_bbr_loss(anchor_boxes, adjustments, groundtruths)
|
||||
assert isinstance(loss, torch.Tensor)
|
||||
assert loss.ndim == 0
|
||||
|
||||
anchor_pos = torch.tensor([10, 100, 10, 100])
|
||||
adj = torch.tensor([0.2, 0.2, 0.2, 0.2])
|
||||
rect = bbr.apply_bbr(anchor_pos, adj)
|
||||
assert isinstance(rect.x1, float)
|
||||