Skip to content

Commit 6f9d209

Browse files
authored
Merge pull request #41 from koba-jon/develop/v2.9.2
Develop/v2.9.2
2 parents 51dab93 + 6e805f1 commit 6f9d209

34 files changed

Lines changed: 1685 additions & 9 deletions

README.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# 🔥 PyTorch C++ Samples 🔥
44

55
[![Language](https://img.shields.io/badge/Language-C++-blue)]()
6-
[![LibTorch](https://img.shields.io/badge/LibTorch-2.9.1-orange)]()
6+
[![LibTorch](https://img.shields.io/badge/LibTorch-2.10.0-orange)]()
77
[![OS](https://img.shields.io/badge/OS-Ubuntu-yellow)]()
88
[![OS](https://img.shields.io/badge/License-MIT-green)]()
99
![sample1](sample1.png)
@@ -60,20 +60,23 @@ $ sh scripts/test.sh
6060

6161
## 🔄 Updates (MM/DD/YYYY)
6262

63+
01/22/2026: Release of `v2.10.0` <br>
64+
12/22/2025: Implementation of `AdaIN` <br>
65+
12/20/2025: Implementation of `NST` <br>
6366
12/06/2025: Release of `v2.9.1.4` <br>
6467
12/01/2025: Release of `v2.9.1.3` <br>
6568
12/01/2025: Implementation of `PatchCore` <br>
6669
11/29/2025: Release of `v2.9.1.2` <br>
6770
11/29/2025: Implementation of `PaDiM` <br>
6871
11/27/2025: Implementation of `WideResNet` <br>
6972
11/27/2025: Release of `v2.9.1.1` <br>
70-
11/24/2025: Implementation of `ESRGAN` <br>
71-
11/21/2025: Implementation of `SRGAN` <br>
72-
11/19/2025: Implementation of `DiT` <br>
7373

7474
<details>
7575
<summary>See more...</summary>
7676

77+
11/24/2025: Implementation of `ESRGAN` <br>
78+
11/21/2025: Implementation of `SRGAN` <br>
79+
11/19/2025: Implementation of `DiT` <br>
7780
11/14/2025: Release of `v2.9.1` <br>
7881
11/01/2025: Implementation of `NeRF` and `3DGS` <br>
7982
10/16/2025: Release of `v2.9.0` <br>
@@ -419,6 +422,29 @@ $ sh scripts/test.sh
419422
</tr>
420423
</table>
421424

425+
### 🖌️ Style Transfer
426+
427+
<table>
428+
<tr>
429+
<th>Model</th>
430+
<th>Paper</th>
431+
<th>Conference/Journal</th>
432+
<th>Code</th>
433+
</tr>
434+
<tr>
435+
<td>Neural Style Transfer</td>
436+
<td><a href="https://openaccess.thecvf.com/content_cvpr_2016/html/Gatys_Image_Style_Transfer_CVPR_2016_paper.html">L. A. Gatys et al.</a></td>
437+
<td>CVPR 2016</td>
438+
<td><a href="Style_Transfer/NST">NST</a></td>
439+
</tr>
440+
<tr>
441+
<td>Adaptive Instance Normalization</td>
442+
<td><a href="https://openaccess.thecvf.com/content_iccv_2017/html/Huang_Arbitrary_Style_Transfer_ICCV_2017_paper.html">X. Huang et al.</a></td>
443+
<td>ICCV 2017</td>
444+
<td><a href="Style_Transfer/AdaIN">AdaIN</a></td>
445+
</tr>
446+
</table>
447+
422448
### 🧩 Semantic Segmentation
423449

424450
<table>
@@ -592,15 +618,15 @@ $ sh scripts/test.sh
592618
Please select the environment to use as follows on PyTorch official. <br>
593619
PyTorch official : https://pytorch.org/ <br>
594620
***
595-
PyTorch Build : Stable (2.9.1) <br>
621+
PyTorch Build : Stable (2.10.0) <br>
596622
Your OS : Linux <br>
597623
Package : LibTorch <br>
598624
Language : C++ / Java <br>
599625
Run this Command : Download here (cxx11 ABI) <br>
600-
CUDA 12.6 : https://download.pytorch.org/libtorch/cu126/libtorch-shared-with-deps-2.9.1%2Bcu126.zip <br>
601-
CUDA 12.8 : https://download.pytorch.org/libtorch/cu128/libtorch-shared-with-deps-2.9.1%2Bcu128.zip <br>
602-
CUDA 13.0 : https://download.pytorch.org/libtorch/cu130/libtorch-shared-with-deps-2.9.1%2Bcu130.zip <br>
603-
CPU : https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.9.1%2Bcpu.zip <br>
626+
CUDA 12.6 : https://download.pytorch.org/libtorch/cu126/libtorch-shared-with-deps-2.10.0%2Bcu126.zip <br>
627+
CUDA 12.8 : https://download.pytorch.org/libtorch/cu128/libtorch-shared-with-deps-2.10.0%2Bcu128.zip <br>
628+
CUDA 13.0 : https://download.pytorch.org/libtorch/cu130/libtorch-shared-with-deps-2.10.0%2Bcu130.zip <br>
629+
CPU : https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.10.0%2Bcpu.zip <br>
604630
***
605631

606632
### 2. OpenCV
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
2+
3+
# Project Name
4+
project(AdaIN CXX)
5+
6+
# Directory Name
7+
set(SUB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../utils)
8+
set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
9+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
10+
11+
# Create Executable File
12+
set(SRCS
13+
${SRC_DIR}/main.cpp
14+
${SRC_DIR}/generate.cpp
15+
${SRC_DIR}/loss.cpp
16+
${SRC_DIR}/networks.cpp
17+
)
18+
19+
add_subdirectory(${SUB_DIR} build)

Style_Transfer/AdaIN/README.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# AdaIN
2+
This is the implementation of "Adaptive Instance Normalization".<br>
3+
Original paper: X. Huang and S. Belongie. Arbitrary Style Transfer in Real-Time With Adaptive Instance Normalization. In Proceedings of the IEEE International Conference on Computer Vision, 2017. [link](https://openaccess.thecvf.com/content_iccv_2017/html/Huang_Arbitrary_Style_Transfer_ICCV_2017_paper.html)
4+
5+
## Usage
6+
7+
### 0. Download pre-trained model
8+
Please download VGG19 pre-trained model with ImageNet.
9+
~~~
10+
$ wget https://huggingface.co/koba-jon/pre-train_cpp/resolve/main/models/vgg19_bn.pth
11+
~~~
12+
13+
### 1. Build
14+
Please build the source file according to the procedure.
15+
~~~
16+
$ mkdir build
17+
$ cd build
18+
$ cmake ..
19+
$ make -j4
20+
$ cd ..
21+
~~~
22+
23+
### 2. Dataset Setting
24+
25+
#### Setting
26+
27+
The following hierarchical relationships are recommended.
28+
29+
~~~
30+
datasets
31+
|--Dataset1
32+
| |--content.png
33+
| |--style.png
34+
|
35+
|--Dataset2
36+
|--Dataset3
37+
~~~
38+
39+
### 3. Image Generation
40+
41+
#### Example 1
42+
43+
- **Content: "Tokyo Night View" — Hiroki Kobayashi**
44+
- **Style: "The Starry Night" — Vincent van Gogh** <br>
45+
Source: https://commons.wikimedia.org/wiki/File:Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg <br>
46+
License: Public Domain <br>
47+
Changes: resized for AdaIN input.
48+
49+
##### Setting
50+
Please set the shell for executable file.
51+
~~~
52+
$ vi scripts/TheStarryNight.sh
53+
~~~
54+
The following is an example of the generation phase.<br>
55+
If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument.
56+
~~~
57+
#!/bin/bash
58+
59+
DATA='TheStarryNight'
60+
61+
./AdaIN \
62+
--generate true \
63+
--iterations 5000 \
64+
--dataset ${DATA} \
65+
--content "content.png" \
66+
--style "style.png" \
67+
--gpu_id 0
68+
~~~
69+
70+
##### Run
71+
Please execute the following to start the program.
72+
~~~
73+
$ sh scripts/TheStarryNight.sh
74+
~~~
75+
76+
#### Example 2
77+
78+
- **Content: "Tokyo Night View" — Hiroki Kobayashi**
79+
- **Style: "The Scream" — Edvard Munch** <br>
80+
Source: https://commons.wikimedia.org/wiki/File:The_Scream.jpg <br>
81+
License: Public Domain <br>
82+
Changes: resized for AdaIN input.
83+
84+
##### Setting
85+
Please set the shell for executable file.
86+
~~~
87+
$ vi scripts/TheScream.sh
88+
~~~
89+
The following is an example of the generation phase.<br>
90+
If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument.
91+
~~~
92+
#!/bin/bash
93+
94+
DATA='TheScream'
95+
96+
./AdaIN \
97+
--generate true \
98+
--iterations 5000 \
99+
--dataset ${DATA} \
100+
--content "content.png" \
101+
--style "style.png" \
102+
--gpu_id 0
103+
~~~
104+
105+
##### Run
106+
Please execute the following to start the program.
107+
~~~
108+
$ sh scripts/TheScream.sh
109+
~~~
110+
600 KB
Loading
574 KB
Loading
600 KB
Loading
347 KB
Loading
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
1. What kind of dataset do you need?
2+
3+
Please prepare images that can be read by OpenCV.
4+
5+
6+
2. What kind of hierarchical relationship do you need?
7+
8+
The following hierarchical relationships are recommended.
9+
10+
---------------------------------------------------------
11+
datasets
12+
|--Dataset1
13+
| |--content.png
14+
| |--style.png
15+
|
16+
|--Dataset2
17+
|--Dataset3
18+
---------------------------------------------------------
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
DATA='TheScream'
4+
5+
./AdaIN \
6+
--generate true \
7+
--iterations 5000 \
8+
--dataset ${DATA} \
9+
--content "content.png" \
10+
--style "style.png" \
11+
--gpu_id 0
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
DATA='TheStarryNight'
4+
5+
./AdaIN \
6+
--generate true \
7+
--iterations 5000 \
8+
--dataset ${DATA} \
9+
--content "content.png" \
10+
--style "style.png" \
11+
--gpu_id 0

0 commit comments

Comments
 (0)