Skip to content

Commit

Permalink
result visualization and Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
jessychen1016 committed Aug 2, 2020
1 parent 48f51ed commit ee18de0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 17 deletions.
46 changes: 33 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ There are a few dependencies required to run the code. They are listed below:

### System Environments:

**Python 3.5+**
`Python >= 3.5`

**CUDA** **10.1**
`CUDA 10.1`

**CuDnn**
`CuDnn`

### Pip dependencies:

**Pytorch 1.5.0**
`Pytorch 1.5.0`

**Torchvision 0.6.0**
`Torchvision 0.6.0`

**Kornia**
`Kornia`

**Graphviz**
`Graphviz`

**Opencv**
`Opencv`

**Scipy**
`Scipy`

**Matplotlib**
`Matplotlib`

**Pandas**
`Pandas`

**TensorboardX**
`TensorboardX`



Expand Down Expand Up @@ -132,4 +132,24 @@ Similarly, there are several options that you can choose when running validation



## **Finally, HAVE FUN with the CODE!!!!**
### Detecting and Infering:

This repository also provided a single pair detecting script so that you can see the result of DPCN directly. A few demos are given in the "./demo" directory including images pairs from both simulation dataset and Aero-Ground Dataset. You could customize the script `detect.py` to test the chosen images pair with relative pretrained model given, and run this code below:

`python detect.py`

The results should be something like this:



![](./images_for_readme/Result1.png)

![Result2](./images_for_readme/Result2.png)







## HAVE FUN with the CODE!!!!
6 changes: 3 additions & 3 deletions detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def detect_model(template_path, source_path, model_template, model_source, model



checkpoint_path = "./checkpoints/laser_sat_qsdjt_9epoch.pt"
template_path = "./demo/temp_2.jpg"
source_path = "./demo/src_2.jpg"
checkpoint_path = "./checkpoints/checkpoint_simulation_hetero.pt"
template_path = "./demo/temp_1.png"
source_path = "./demo/src_1.png"

load_pretrained =True
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
Expand Down
Binary file added images_for_readme/Result1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images_for_readme/Result2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def align_image(template, source):
source = source.cpu().detach().numpy()
template = template.squeeze(0) # remove the fake batch dimension
source = source.squeeze(0) # remove the fake batch dimension
dst = cv2.addWeighted(template, 0.4, source, 0.6, 0)
dst = cv2.addWeighted(template, 1, source, 0.6, 0)
# plt.imshow(dst, cmap="gray")
# plt.show() # pause a bit so that plots are updated
return dst
Expand Down

0 comments on commit ee18de0

Please sign in to comment.