scales annotations

This commit is contained in:
franksim
2025-11-09 13:01:46 +01:00
parent 85fd327052
commit 93d752209f
52 changed files with 84 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

BIN
mmp/a4/2243119_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

BIN
mmp/a4/2244764_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
mmp/a4/2244924_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

BIN
mmp/a4/2250234_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

BIN
mmp/a4/2251430_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 892 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

BIN
mmp/a4/2254610_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
mmp/a4/2256266_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

BIN
mmp/a4/2256880_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
mmp/a4/2258993_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

BIN
mmp/a4/2260471_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
mmp/a4/2261564_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
mmp/a4/2262264_original.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

View File

@@ -29,7 +29,7 @@ class MMP_Dataset(torch.utils.data.Dataset):
@param is_test: Whether this is the test set (True) or the validation/training set (False)
"""
self.image_size = image_size
self.images = []
self.images: Sequence[Tuple[str, Sequence[AnnotationRect]]] = []
self.anchor_grid = anchor_grid
self.min_iou = min_iou
self.is_test = is_test
@@ -72,8 +72,14 @@ class MMP_Dataset(torch.utils.data.Dataset):
img_id = re.match(r".*(\/)([0-9]+)(\.[^\/]*$)", self.images[idx][0]).group(2)
if self.is_test:
return (img_tensor, torch.Tensor(), int(img_id))
scaled_annotations = []
for annotation in self.images[idx][1]:
annotation.scale(self.image_size / max(img.size[0], img.size[1]))
scaled_annotations.append(annotation)
label_grid = get_label_grid(
anchor_grid=self.anchor_grid, gts=self.images[idx][1], min_iou=self.min_iou
anchor_grid=self.anchor_grid, gts=scaled_annotations, min_iou=self.min_iou
)
return (img_tensor, label_grid, int(img_id))

BIN
mmp/a4/document.pdf Normal file

Binary file not shown.

70
mmp/a4/document.tex Normal file
View File

@@ -0,0 +1,70 @@
\documentclass[11pt,a4paper]{article}
% Language and encoding settings
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
% Page formatting
\usepackage[left=1in, right=1in, top=1in, bottom=1in]{geometry}
\usepackage{setspace}
\onehalfspacing
% Header/Footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\fancyhead[L]{\textbf{\course}}
\fancyhead[C]{Assignment \assignmentnumber}
\fancyhead[R]{\name}
\fancyfoot[C]{\thepage}
% Other packages
\usepackage{enumitem}
\usepackage{graphicx}
% Custom commands for easy detail insertion
\newcommand{\assignmentnumber}{04} % <-- CHANGE Assignment Number
\newcommand{\name}{Simon Franken} % <-- CHANGE YOUR NAME
\newcommand{\course}{Multimedia Project WiSe 2526} % <-- CHANGE COURSE NAME
\newcommand{\duedate}{2025-11-12} % <-- CHANGE DUE DATE
% Title formatting
\usepackage{titling}
\pretitle{
\vspace*{2cm}
\begin{center}
\LARGE\bfseries
}
\posttitle{\par\end{center}\vspace{1cm}}
\begin{document}
\title{Assignment \assignmentnumber}
\author{\name}
\date{\duedate}
\maketitle
\begin{center}
\textbf{Course:} \course
\end{center}
\vspace{0.5cm}
%------------------ START OF ASSIGNMENT -----------------------
% Write your solutions below
\section*{Exercise 4.2 Label Grid}
\begin{enumerate}[label=\alph*)]
\setcounter{enumi}{2}
\item \begin{figure}[htp]
\centering
\includegraphics[width=4cm]{output.jpg}
\caption{output.txt}
\end{figure}
\end{enumerate}
%------------------ END OF ASSIGNMENT -----------------------
\end{document}