feat: add GAN

This commit is contained in:
2026-05-30 14:49:40 +03:00
parent 6477ce0776
commit 72e1950127
29 changed files with 2670 additions and 361 deletions

View File

@@ -0,0 +1,118 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1800" height="1000" viewBox="0 0 1800 1000">
<defs>
<marker id="arrow" markerWidth="16" markerHeight="16" refX="14" refY="8" orient="auto">
<path d="M0,0 L16,8 L0,16 Z" fill="#1f2937"/>
</marker>
<style>
.bg { fill: #fafafa; }
.title { font: 700 40px Arial, sans-serif; fill: #111827; }
.subtitle { font: 400 21px Arial, sans-serif; fill: #4b5563; }
.box { stroke-width: 3; rx: 18; }
.blue { fill: #eaf3ff; stroke: #3b82f6; }
.orange { fill: #fff1df; stroke: #f59e0b; }
.violet { fill: #f0ebff; stroke: #7c3aed; }
.green { fill: #eaf8ef; stroke: #22a06b; }
.red { fill: #fff1f2; stroke: #ef4444; }
.label { font: 700 27px Arial, sans-serif; fill: #111827; text-anchor: middle; }
.desc { font: 400 18px Arial, sans-serif; fill: #4b5563; text-anchor: middle; }
.small { font: 400 16px Arial, sans-serif; fill: #6b7280; text-anchor: middle; }
.arrow { stroke: #1f2937; stroke-width: 4; fill: none; marker-end: url(#arrow); }
.branch { stroke: #6b7280; stroke-width: 3.5; fill: none; marker-end: url(#arrow); }
.icon-line { stroke: #111827; stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.patch-grid { stroke: #7c3aed; stroke-width: 3; fill: none; }
.p1 { fill: #bbf7d0; }
.p2 { fill: #fde68a; }
.p3 { fill: #fecaca; }
.stage { font: 700 20px Arial, sans-serif; fill: #374151; text-anchor: middle; }
</style>
</defs>
<rect class="bg" width="1800" height="1000"/>
<text class="title" x="90" y="80">Дискриминатор PatchGAN</text>
<text class="subtitle" x="90" y="118">Проверяет пару изображений локальными патчами: настоящая ли это пара Google + Яндекс или результат генератора</text>
<text class="stage" x="245" y="195">Входные пары</text>
<text class="stage" x="690" y="195">Объединение</text>
<text class="stage" x="1125" y="195">PatchGAN</text>
<text class="stage" x="1530" y="195">Оценка</text>
<g transform="translate(90 240)">
<rect class="box green" width="310" height="205"/>
<text class="label" x="155" y="54">Real pair</text>
<text class="desc" x="155" y="85">Google + настоящий Яндекс</text>
<text class="small" x="155" y="116">целевая метка: 1</text>
<path class="icon-line" d="M78 158 C112 130, 150 176, 190 145 C211 128, 230 124, 250 122"/>
</g>
<g transform="translate(90 555)">
<rect class="box red" width="310" height="205"/>
<text class="label" x="155" y="54">Fake pair</text>
<text class="desc" x="155" y="85">Google + Generated Яндекс</text>
<text class="small" x="155" y="116">целевая метка: 0</text>
<path class="icon-line" d="M78 158 C112 130, 150 176, 190 145 C211 128, 230 124, 250 122"/>
</g>
<path class="branch" d="M420 342 H485 V470 H545"/>
<path class="branch" d="M420 657 H485 V520 H545"/>
<g transform="translate(565 390)">
<rect class="box blue" width="255" height="210"/>
<text class="label" x="128" y="58">Concat</text>
<text class="desc" x="128" y="92">6 каналов</text>
<text class="small" x="128" y="124">RGB Google + RGB Yandex</text>
<text class="small" x="128" y="154">B x 6 x 256 x 256</text>
</g>
<path class="arrow" d="M840 495 H930"/>
<g transform="translate(950 295)">
<rect class="box violet" width="350" height="400"/>
<text class="label" x="175" y="58">Сверточные блоки</text>
<text class="desc" x="175" y="92">Conv + BatchNorm + LeakyReLU</text>
<path class="icon-line" d="M78 170 H272"/>
<path class="icon-line" d="M78 230 H272"/>
<path class="icon-line" d="M78 290 H272"/>
<circle cx="95" cy="170" r="12" fill="#bfdbfe" stroke="#111827" stroke-width="4"/>
<circle cx="155" cy="170" r="12" fill="#bfdbfe" stroke="#111827" stroke-width="4"/>
<circle cx="215" cy="170" r="12" fill="#bfdbfe" stroke="#111827" stroke-width="4"/>
<circle cx="120" cy="230" r="12" fill="#c4b5fd" stroke="#111827" stroke-width="4"/>
<circle cx="180" cy="230" r="12" fill="#c4b5fd" stroke="#111827" stroke-width="4"/>
<circle cx="240" cy="230" r="12" fill="#c4b5fd" stroke="#111827" stroke-width="4"/>
<circle cx="145" cy="290" r="12" fill="#fed7aa" stroke="#111827" stroke-width="4"/>
<circle cx="205" cy="290" r="12" fill="#fed7aa" stroke="#111827" stroke-width="4"/>
<text class="small" x="175" y="352">64 -> 128 -> 256 -> 512</text>
</g>
<path class="arrow" d="M1320 495 H1410"/>
<g transform="translate(1430 295)">
<rect class="box orange" width="280" height="400"/>
<text class="label" x="140" y="58">Patch map</text>
<text class="desc" x="140" y="92">оценка real/fake</text>
<g transform="translate(78 135)">
<rect class="patch-grid" width="124" height="124" rx="8"/>
<rect class="p1" x="10" y="10" width="28" height="28"/>
<rect class="p2" x="48" y="10" width="28" height="28"/>
<rect class="p1" x="86" y="10" width="28" height="28"/>
<rect class="p2" x="10" y="48" width="28" height="28"/>
<rect class="p1" x="48" y="48" width="28" height="28"/>
<rect class="p3" x="86" y="48" width="28" height="28"/>
<rect class="p1" x="10" y="86" width="28" height="28"/>
<rect class="p2" x="48" y="86" width="28" height="28"/>
<rect class="p1" x="86" y="86" width="28" height="28"/>
</g>
<text class="small" x="140" y="310">каждая ячейка</text>
<text class="small" x="140" y="336">соответствует локальной</text>
<text class="small" x="140" y="362">области изображения</text>
</g>
<path class="arrow" d="M1570 720 V755 H1095 V785"/>
<g transform="translate(855 790)">
<rect class="box green" width="480" height="130"/>
<text class="label" x="240" y="50">Функция потерь</text>
<text class="desc" x="240" y="82">реальная пара -> 1, сгенерированная пара -> 0</text>
</g>
<text class="small" x="900" y="960">Главная идея PatchGAN: проверять не всю карту одним числом, а локальные признаки стиля и структуры.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@@ -0,0 +1,119 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1800" height="1000" viewBox="0 0 1800 1000">
<defs>
<marker id="arrow" markerWidth="16" markerHeight="16" refX="14" refY="8" orient="auto">
<path d="M0,0 L16,8 L0,16 Z" fill="#1f2937"/>
</marker>
<style>
.bg { fill: #fafafa; }
.title { font: 700 40px Arial, sans-serif; fill: #111827; }
.subtitle { font: 400 21px Arial, sans-serif; fill: #4b5563; }
.stage { font: 700 20px Arial, sans-serif; fill: #374151; text-anchor: middle; }
.box { stroke-width: 3; rx: 18; }
.blue { fill: #eaf3ff; stroke: #3b82f6; }
.orange { fill: #fff1df; stroke: #f59e0b; }
.green { fill: #eaf8ef; stroke: #22a06b; }
.violet { fill: #f0ebff; stroke: #7c3aed; }
.main { font: 700 28px Arial, sans-serif; fill: #111827; text-anchor: middle; }
.desc { font: 400 18px Arial, sans-serif; fill: #4b5563; text-anchor: middle; }
.small { font: 400 16px Arial, sans-serif; fill: #6b7280; text-anchor: middle; }
.arrow { stroke: #1f2937; stroke-width: 4; fill: none; marker-end: url(#arrow); }
.thin { stroke: #6b7280; stroke-width: 3; fill: none; marker-end: url(#arrow); }
.dash { stroke: #6b7280; stroke-width: 3; fill: none; stroke-dasharray: 10 9; marker-end: url(#arrow); }
.icon-line { stroke: #111827; stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { fill: #ffffff; stroke: #111827; stroke-width: 4; }
.kp { fill: #16a34a; stroke: #ffffff; stroke-width: 3; }
.bad { fill: #ef4444; stroke: #ffffff; stroke-width: 3; }
</style>
</defs>
<rect class="bg" width="1800" height="1000"/>
<text class="title" x="90" y="80">Применение GAN для приведения карт к единому домену</text>
<text class="subtitle" x="90" y="118">Нейросеть меняет стиль карты, а дальнейшее сопоставление выполняется классическими геометрическими методами</text>
<text class="stage" x="255" y="190">Исходные данные</text>
<text class="stage" x="720" y="190">Доменная адаптация</text>
<text class="stage" x="1185" y="190">Сопоставление</text>
<text class="stage" x="1545" y="190">Результат</text>
<g transform="translate(90 235)">
<rect class="box blue" width="330" height="210"/>
<text class="main" x="165" y="54">Google Maps</text>
<text class="desc" x="165" y="86">фрагмент области полета</text>
<path class="icon-line" d="M85 145 C122 118, 164 169, 210 132 C230 116, 248 111, 272 110"/>
<path class="icon-line" d="M82 170 L280 118"/>
<circle class="kp" cx="116" cy="142" r="9"/>
<circle class="kp" cx="208" cy="132" r="9"/>
</g>
<g transform="translate(90 555)">
<rect class="box orange" width="330" height="210"/>
<text class="main" x="165" y="54">Яндекс.Карты</text>
<text class="desc" x="165" y="86">эталон с ориентирами</text>
<path class="icon-line" d="M85 145 C122 118, 164 169, 210 132 C230 116, 248 111, 272 110"/>
<path class="icon-line" d="M82 170 L280 118"/>
<circle class="kp" cx="116" cy="142" r="9"/>
<circle class="kp" cx="208" cy="132" r="9"/>
</g>
<path class="arrow" d="M440 340 H555"/>
<g transform="translate(575 300)">
<rect class="box orange" width="290" height="260"/>
<text class="main" x="145" y="58">GAN</text>
<text class="desc" x="145" y="91">Google -> Yandex</text>
<path class="icon-line" d="M80 170 L115 128 L150 170 L185 128 L220 170"/>
<text class="small" x="145" y="218">сохраняет геометрию</text>
<text class="small" x="145" y="242">меняет визуальный стиль</text>
</g>
<path class="arrow" d="M885 430 H1000"/>
<g transform="translate(1020 300)">
<rect class="box orange" width="330" height="260"/>
<text class="main" x="165" y="58">Сгенерированный кадр</text>
<text class="desc" x="165" y="91">карта в целевом домене</text>
<path class="icon-line" d="M85 166 C122 139, 164 190, 210 153 C230 137, 248 132, 272 131"/>
<path class="icon-line" d="M82 191 L280 139"/>
<circle class="kp" cx="116" cy="163" r="9"/>
<circle class="kp" cx="208" cy="153" r="9"/>
<circle class="kp" cx="250" cy="139" r="9"/>
</g>
<path class="dash" d="M420 660 C635 775, 940 775, 1040 580"/>
<path class="thin" d="M1185 580 V650"/>
<g transform="translate(1020 650)">
<rect class="box green" width="330" height="190"/>
<text class="main" x="165" y="52">Ключевые точки</text>
<text class="desc" x="165" y="84">ORB / SIFT / AKAZE</text>
<circle class="kp" cx="92" cy="132" r="10"/>
<circle class="kp" cx="142" cy="116" r="10"/>
<circle class="kp" cx="193" cy="139" r="10"/>
<circle class="kp" cx="244" cy="111" r="10"/>
<path class="icon-line" d="M90 132 L142 116 L193 139 L244 111"/>
</g>
<path class="arrow" d="M1370 745 H1445"/>
<g transform="translate(1465 650)">
<rect class="box green" width="245" height="190"/>
<text class="main" x="122" y="52">RANSAC</text>
<text class="desc" x="122" y="84">отбор совпадений</text>
<circle class="kp" cx="83" cy="130" r="10"/>
<circle class="kp" cx="124" cy="114" r="10"/>
<circle class="bad" cx="164" cy="137" r="10"/>
</g>
<path class="arrow" d="M1590 630 V530"/>
<g transform="translate(1425 300)">
<rect class="box violet" width="285" height="260"/>
<text class="main" x="142" y="58">Гомография H</text>
<text class="desc" x="142" y="91">связь координат</text>
<path class="icon-fill" d="M95 135 L172 118 L196 184 L112 201 Z"/>
<path class="icon-line" d="M103 212 L197 110"/>
<text class="small" x="142" y="238">коррекция позиции БПЛА</text>
</g>
<text class="small" x="900" y="930">Итог: изображения становятся визуально ближе, поэтому классические методы получают больше устойчивых совпадений.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@@ -0,0 +1,104 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1700" height="920" viewBox="0 0 1700 920">
<defs>
<marker id="arrow" markerWidth="12" markerHeight="12" refX="10" refY="6" orient="auto">
<path d="M0,0 L12,6 L0,12 Z" fill="#344054"/>
</marker>
<style>
.bg { fill: #fbfcfe; }
.title { font: 700 34px Arial, sans-serif; fill: #172033; }
.subtitle { font: 400 18px Arial, sans-serif; fill: #526070; }
.block { stroke: #344054; stroke-width: 2; rx: 10; }
.down { fill: #d9ecff; }
.bottle { fill: #fff0cf; }
.up { fill: #e6f5dc; }
.out { fill: #eee7ff; }
.label { font: 700 17px Arial, sans-serif; fill: #172033; text-anchor: middle; }
.small { font: 400 14px Arial, sans-serif; fill: #4b5563; text-anchor: middle; }
.axis { stroke: #344054; stroke-width: 3; fill: none; marker-end: url(#arrow); }
.skip { stroke: #d47f20; stroke-width: 3; fill: none; stroke-dasharray: 9 7; marker-end: url(#arrow); }
.arrow { stroke: #344054; stroke-width: 3; fill: none; marker-end: url(#arrow); }
.note { font: 400 16px Arial, sans-serif; fill: #667085; }
</style>
</defs>
<rect class="bg" width="1700" height="920"/>
<text class="title" x="80" y="70">Архитектура генератора U-Net: Google Maps -&gt; Яндекс.Карты</text>
<text class="subtitle" x="80" y="104">Сжатие изображения до признакового представления и восстановление в целевом стиле с сохранением геометрии через skip-соединения</text>
<g id="encoder">
<rect class="block down" x="80" y="230" width="120" height="360"/>
<text class="label" x="140" y="255">Input</text>
<text class="small" x="140" y="280">3 x 256 x 256</text>
<text class="small" x="140" y="550">Google RGB</text>
<rect class="block down" x="240" y="265" width="120" height="290"/>
<text class="label" x="300" y="292">Down 1</text>
<text class="small" x="300" y="318">64</text>
<text class="small" x="300" y="532">128 x 128</text>
<rect class="block down" x="400" y="295" width="120" height="230"/>
<text class="label" x="460" y="322">Down 2</text>
<text class="small" x="460" y="348">128</text>
<text class="small" x="460" y="502">64 x 64</text>
<rect class="block down" x="560" y="325" width="120" height="170"/>
<text class="label" x="620" y="352">Down 3</text>
<text class="small" x="620" y="378">256</text>
<text class="small" x="620" y="472">32 x 32</text>
<rect class="block down" x="720" y="350" width="120" height="120"/>
<text class="label" x="780" y="377">Down 4</text>
<text class="small" x="780" y="403">512</text>
<text class="small" x="780" y="448">16 x 16</text>
</g>
<rect class="block bottle" x="880" y="372" width="120" height="76"/>
<text class="label" x="940" y="399">Bottleneck</text>
<text class="small" x="940" y="425">512</text>
<g id="decoder">
<rect class="block up" x="1040" y="350" width="120" height="120"/>
<text class="label" x="1100" y="377">Up 4</text>
<text class="small" x="1100" y="403">512</text>
<text class="small" x="1100" y="448">16 x 16</text>
<rect class="block up" x="1200" y="325" width="120" height="170"/>
<text class="label" x="1260" y="352">Up 5</text>
<text class="small" x="1260" y="378">256</text>
<text class="small" x="1260" y="472">32 x 32</text>
<rect class="block up" x="1360" y="295" width="120" height="230"/>
<text class="label" x="1420" y="322">Up 6</text>
<text class="small" x="1420" y="348">128</text>
<text class="small" x="1420" y="502">64 x 64</text>
<rect class="block up" x="1520" y="265" width="120" height="290"/>
<text class="label" x="1580" y="292">Up 7</text>
<text class="small" x="1580" y="318">64</text>
<text class="small" x="1580" y="532">128 x 128</text>
</g>
<rect class="block out" x="1370" y="650" width="250" height="95"/>
<text class="label" x="1495" y="684">Final Conv + Tanh</text>
<text class="small" x="1495" y="711">3 x 256 x 256</text>
<text class="small" x="1495" y="734">Generated Yandex RGB</text>
<path class="arrow" d="M205 410 L235 410"/>
<path class="arrow" d="M365 410 L395 410"/>
<path class="arrow" d="M525 410 L555 410"/>
<path class="arrow" d="M685 410 L715 410"/>
<path class="arrow" d="M845 410 L875 410"/>
<path class="arrow" d="M1005 410 L1035 410"/>
<path class="arrow" d="M1165 410 L1195 410"/>
<path class="arrow" d="M1325 410 L1355 410"/>
<path class="arrow" d="M1485 410 L1515 410"/>
<path class="arrow" d="M1580 560 C1580 610, 1530 620, 1495 645"/>
<path class="skip" d="M300 255 C300 145, 1580 145, 1580 260"/>
<path class="skip" d="M460 290 C460 185, 1420 185, 1420 290"/>
<path class="skip" d="M620 320 C620 225, 1260 225, 1260 320"/>
<path class="skip" d="M780 345 C780 265, 1100 265, 1100 345"/>
<text class="note" x="90" y="805">Down-блок: Conv2d, BatchNorm, LeakyReLU. Up-блок: Upsample, Conv2d, BatchNorm, ReLU, затем конкатенация со skip-признаками.</text>
<text class="note" x="90" y="835">Назначение skip-соединений: сохранить дороги, перекрестки и контуры объектов при изменении визуального стиля карты.</text>
</svg>

After

Width:  |  Height:  |  Size: 5.3 KiB