Spaces:
Sleeping
Sleeping
rynmurdock
commited on
Commit
β’
211e953
1
Parent(s):
a436eb7
longer calibration
Browse files- second.png β 10o.png +2 -2
- first.png β 1o.png +0 -0
- fifth.png β 2o.png +0 -0
- sixth.png β 3o.png +0 -0
- third.png β 4o.png +0 -0
- fourth.png β 5o.png +0 -0
- 6o.png +3 -0
- 7o.png +3 -0
- 8o.png +3 -0
- 9o.png +3 -0
- app.py +24 -13
second.png β 10o.png
RENAMED
File without changes
|
first.png β 1o.png
RENAMED
File without changes
|
fifth.png β 2o.png
RENAMED
File without changes
|
sixth.png β 3o.png
RENAMED
File without changes
|
third.png β 4o.png
RENAMED
File without changes
|
fourth.png β 5o.png
RENAMED
File without changes
|
6o.png
ADDED
Git LFS Details
|
7o.png
ADDED
Git LFS Details
|
8o.png
ADDED
Git LFS Details
|
9o.png
ADDED
Git LFS Details
|
app.py
CHANGED
@@ -194,7 +194,7 @@ def get_user_emb(embs, ys):
|
|
194 |
print('Dropping at 20')
|
195 |
|
196 |
if mini < 1:
|
197 |
-
feature_embs = torch.stack([torch.randn(
|
198 |
ys_t = [0, 1]
|
199 |
print('Not enough ratings.')
|
200 |
else:
|
@@ -386,8 +386,9 @@ def choose(img, choice, calibrate_prompts, user_id, request: gr.Request):
|
|
386 |
# if it's still in the dataframe, add the choice
|
387 |
if len(prevs_df.loc[row_mask, 'user:rating']) > 0:
|
388 |
prevs_df.loc[row_mask, 'user:rating'][0][user_id] = choice
|
|
|
389 |
prevs_df.loc[row_mask, 'latest_user_to_rate'] = [user_id]
|
390 |
-
img, calibrate_prompts
|
391 |
return img, calibrate_prompts
|
392 |
|
393 |
css = '''.gradio-container{max-width: 700px !important}
|
@@ -451,11 +452,16 @@ Explore the latent space without text prompts based on your preferences. Learn m
|
|
451 |
user_id = gr.State()
|
452 |
# calibration videos -- this is a misnomer now :D
|
453 |
calibrate_prompts = gr.State([
|
454 |
-
'./
|
455 |
-
'./
|
456 |
-
'./
|
457 |
-
'./
|
458 |
-
'./
|
|
|
|
|
|
|
|
|
|
|
459 |
])
|
460 |
def l():
|
461 |
return None
|
@@ -543,12 +549,17 @@ def encode_space(x):
|
|
543 |
return im_emb.detach().to('cpu').to(torch.float32)
|
544 |
|
545 |
# prep our calibration videos
|
546 |
-
for im, txt in [ #
|
547 |
-
('./
|
548 |
-
('./
|
549 |
-
('./
|
550 |
-
('./
|
551 |
-
('./
|
|
|
|
|
|
|
|
|
|
|
552 |
]:
|
553 |
tmp_df = pd.DataFrame(columns=['paths', 'embeddings', 'ips', 'user:rating', 'text', 'gemb'])
|
554 |
tmp_df['paths'] = [im]
|
|
|
194 |
print('Dropping at 20')
|
195 |
|
196 |
if mini < 1:
|
197 |
+
feature_embs = torch.stack([torch.randn(1024), torch.randn(1024)])
|
198 |
ys_t = [0, 1]
|
199 |
print('Not enough ratings.')
|
200 |
else:
|
|
|
386 |
# if it's still in the dataframe, add the choice
|
387 |
if len(prevs_df.loc[row_mask, 'user:rating']) > 0:
|
388 |
prevs_df.loc[row_mask, 'user:rating'][0][user_id] = choice
|
389 |
+
print(row_mask, prevs_df.loc[row_mask, 'latest_user_to_rate'], [user_id])
|
390 |
prevs_df.loc[row_mask, 'latest_user_to_rate'] = [user_id]
|
391 |
+
img, calibrate_prompts = next_image(calibrate_prompts, user_id)
|
392 |
return img, calibrate_prompts
|
393 |
|
394 |
css = '''.gradio-container{max-width: 700px !important}
|
|
|
452 |
user_id = gr.State()
|
453 |
# calibration videos -- this is a misnomer now :D
|
454 |
calibrate_prompts = gr.State([
|
455 |
+
'./5o.png',
|
456 |
+
'./2o.png',
|
457 |
+
'./6o.png',
|
458 |
+
'./7o.png',
|
459 |
+
'./1o.png',
|
460 |
+
'./8o.png',
|
461 |
+
'./3o.png',
|
462 |
+
'./4o.png',
|
463 |
+
'./10o.png',
|
464 |
+
'./9o.png',
|
465 |
])
|
466 |
def l():
|
467 |
return None
|
|
|
549 |
return im_emb.detach().to('cpu').to(torch.float32)
|
550 |
|
551 |
# prep our calibration videos
|
552 |
+
for im, txt in [ # DO NOT NAME THESE PNGs JUST NUMBERS! apparently we assign images by number
|
553 |
+
('./1o.png', 'describe the scene: omens in the suburbs'),
|
554 |
+
('./2o.png', 'describe the scene: geometric abstract art of a windmill'),
|
555 |
+
('./3o.png', 'describe the scene: memento mori'),
|
556 |
+
('./4o.png', 'describe the scene: a green plate with anespresso'),
|
557 |
+
('./5o.png', '5 '),
|
558 |
+
('./6o.png', '6 '),
|
559 |
+
('./7o.png', '7 '),
|
560 |
+
('./8o.png', '8 '),
|
561 |
+
('./9o.png', '9 '),
|
562 |
+
('./10o.png', '10 '),
|
563 |
]:
|
564 |
tmp_df = pd.DataFrame(columns=['paths', 'embeddings', 'ips', 'user:rating', 'text', 'gemb'])
|
565 |
tmp_df['paths'] = [im]
|