Skip to content

Commit

Permalink
prepping final release of code
Browse files Browse the repository at this point in the history
  • Loading branch information
iamerich committed Jun 10, 2023
1 parent 71d897a commit c4fc830
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 155 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ Here are instructions on how to run the repository:
```
2. Run the evaluation script:
```shell
conda activate keypoint_correspondences_ldm
conda activate LDM_correspondences
python3 -m eval.eval
```
3. More options can be found with
```shell
python3 -m eval.eval --help
```

## Visualizing Attention Maps

Expand All @@ -25,7 +29,7 @@ The project includes an interactive local website for visualizing attention maps
1. Activate the conda environment and run the evaluation script with visualization:

```shell
conda activate keypoint_correspondences_ldm
conda activate LDM_correspondences
python3 -m eval.eval --visualize
```

Expand Down
5 changes: 1 addition & 4 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: keypoint_correspondences_ldm
name: LDM_correspondences
channels:
- xformers/label/dev
- pytorch
- nvidia
- conda-forge
Expand Down Expand Up @@ -154,7 +153,6 @@ dependencies:
- urllib3=1.26.14=pyhd8ed1ab_0
- wcwidth=0.2.5=pyhd3eb1b0_0
- wheel=0.37.1=pyhd3eb1b0_0
- xformers=0.0.17.dev435+git.5df1f0b=py310_cu11.6_pyt1.12.1
- xz=5.2.8=h5eee18b_0
- zeromq=4.3.4=h2531618_0
- zlib=1.2.13=h5eee18b_0
Expand Down Expand Up @@ -240,4 +238,3 @@ dependencies:
- werkzeug==2.3.0
- widgetsnbextension==4.0.5
- zipp==3.11.0
prefix: /scratch/iamerich/miniconda3/envs/prompt-to-prompt
11 changes: 2 additions & 9 deletions eval/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
choices=['spair', 'pfwillow', 'cubs', 'custom'], default='custom')
parser.add_argument('--thres', type=str, default='auto',
choices=['auto', 'img', 'bbox'])
parser.add_argument('--alpha', type=float, default=0.1,
help='alpha for the pck threshold')
parser.add_argument('--sub_class', type=str, default="all", choices=['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus',
'car', 'cat', 'chair', 'cow', 'dog', 'horse', 'motorbike', 'person', 'pottedplant', 'sheep', 'train', 'tvmonitor', 'all'])
parser.add_argument('--split', type=str, default="test",
Expand Down Expand Up @@ -65,7 +63,6 @@
default='CompVis/stable-diffusion-v1-4', help='ldm model type')
parser.add_argument('--upsample_res', type=int, default=512,
help='Resolution to upsample the attention maps to')
parser.add_argument('--num_words', type=int, default=2)

# Run details
parser.add_argument('--wandb_log', action='store_true',
Expand All @@ -83,9 +80,9 @@
help='what epoch of the model to load')
parser.add_argument('--save_loc', type=str, default='outputs',
help='save location for the trained model')
parser.add_argument('--results_loc', type=str, default='/scratch/iamerich/prompt-to-prompt/outputs/ldm_visualization_020',
parser.add_argument('--results_loc', type=str, default='outputs/',
help='save location for the trained model')
parser.add_argument('--seed', type=int, default=2023,
parser.add_argument('--seed', type=int, default=-1,
help='Pseudo-RNG seed')
parser.add_argument('--ablate', action='store_true',
help='evaluate over a smaller number of points')
Expand All @@ -94,10 +91,6 @@

args = parser.parse_args()

# from glob import glob
# if args.item_index != -1 and len(glob(f"/home/iamerich/burst/pfwillow_no_crop_ablation/{args.item_index}/*.txt")) > 0:
# exit()


if args.seed != -1:
random.seed(args.seed)
Expand Down
139 changes: 0 additions & 139 deletions eval/eval_spair_categories.py

This file was deleted.

2 changes: 1 addition & 1 deletion utils/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def retest(ldm,
item_index = -1,
ablate_results = False,
num_iterations = 20,
results_loc = "/scratch/iamerich/prompt-to-prompt/outputs/ldm_visualization_020",
results_loc = "outputs/",
save_folder = "outputs"):
"""
Takes the saved text embeddings and re-evaluates them
Expand Down

0 comments on commit c4fc830

Please sign in to comment.