Skip to content

Commit affbeba

Browse files
committed
Update README
1 parent bd8187f commit affbeba

File tree

9 files changed

+11
-5
lines changed

9 files changed

+11
-5
lines changed

LocalMatching.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
def plot_matching_figure(image1, image2, xyA_list, xyB_list, save_path):
16-
fig = plt.figure(figsize=(10,10))
16+
fig = plt.figure(figsize=(11,5))
1717
ax1 = fig.add_subplot(121)
1818
ax2 = fig.add_subplot(122)
1919

@@ -22,12 +22,15 @@ def plot_matching_figure(image1, image2, xyA_list, xyB_list, save_path):
2222

2323
for xyA, xyB in zip(xyA_list, xyB_list):
2424
con = ConnectionPatch(xyA=xyB, xyB=xyA, coordsA="data", coordsB="data",
25-
axesA=ax2, axesB=ax1, color="red")
25+
axesA=ax2, axesB=ax1, color="green")
2626
ax2.add_artist(con)
2727

2828
fig.tight_layout()
29+
ax1.axis('off')
30+
ax2.axis('off')
31+
plt.subplots_adjust(wspace=0.05)
2932
fig.show()
30-
fig.savefig(save_path)
33+
fig.savefig(save_path, bbox_inches='tight', pad_inches=0, dpi=400)
3134

3235

3336

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Polyp-Gen
1+
# Polyp-Gen: Realistic and Diverse Polyp Image Generation for Endoscopic Dataset Expansion
2+
![introduction](assets/pipeline.jpg)
23

34
## Setup
45

@@ -25,7 +26,7 @@ You can train your own model using the script:
2526
bash scripts/train.sh
2627
```
2728
## Sampling
28-
29+
![sampling](assets/showcase.jpg)
2930
### Checkpoint
3031
You can download the chekpoints of our Polyp_Gen from [here](https://huggingface.co/Saint-lsy/Polyp-Gen-sd2-inpainting/tree/main).
3132
### Sampling with Specified Mask
@@ -48,6 +49,8 @@ One Demo of LocalMatching
4849
python LocalMatching.py --ref_image demos/img_1513_neg.jpg --ref_mask demos/mask_1513.jpg --query_image demos/img_1592_neg.jpg --mask_proposal gen_mask.jpg
4950
```
5051

52+
<img src="assets/matching.jpg" alt="local_matching" width="450">
53+
5154
The third step is using the generated Mask to sample.
5255
## Acknowledgements
5356
The code is based on the following projects. Greatly thanks to these authors!

assets/matching.jpg

375 KB
Loading

assets/pipeline.jpg

650 KB
Loading

assets/showcase.jpg

516 KB
Loading

demos/demo2_img.jpg

344 KB
Loading

demos/demo2_mask.jpg

4.64 KB
Loading

demos/demo_img.jpg

-319 KB
Loading

demos/demo_mask.jpg

-249 Bytes
Loading

0 commit comments

Comments
 (0)