awacke1 commited on
Commit
22dbfdd
1 Parent(s): b6708b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -1
app.py CHANGED
@@ -10,10 +10,30 @@ Gans=["biggan-deep-128", "biggan-deep-256", "biggan-deep-512"]
10
 
11
  model_names={"vqgan_imagenet_f16_16384": 'ImageNet 16384',"vqgan_imagenet_f16_1024":"ImageNet 1024", 'vqgan_openimages_f16_8192':'OpenImages 8912',"wikiart_1024":"WikiArt 1024", "wikiart_16384":"WikiArt 16384", "coco":"COCO-Stuff", "faceshq":"FacesHQ", "sflckr":"S-FLCKR"}
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  io1 = gr.Interface.load('huggingface/osanseviero/BigGAN-deep-128')
15
  io2 = gr.Interface.load('huggingface/osanseviero/BigGAN-deep-128')
16
- io3 = gr.Interface.load('vqgan_imagenet_f16_16384')
 
17
  #io3 = gr.Interface.load("huggingface/emilyalsentzer/Bio_Discharge_Summary_BERT")
18
  #io3 = gr.Interface.load("huggingface/google/pegasus-pubmed")
19
  #io3 = gr.Interface.load("huggingface/tennessejoyce/titlewave-t5-base")
 
10
 
11
  model_names={"vqgan_imagenet_f16_16384": 'ImageNet 16384',"vqgan_imagenet_f16_1024":"ImageNet 1024", 'vqgan_openimages_f16_8192':'OpenImages 8912',"wikiart_1024":"WikiArt 1024", "wikiart_16384":"WikiArt 16384", "coco":"COCO-Stuff", "faceshq":"FacesHQ", "sflckr":"S-FLCKR"}
12
 
13
+ import os
14
+ import torch
15
+ from PIL import Image
16
+ from torchvision import transforms
17
+
18
+ # === SEMI-WEAKLY SUPERVISED MODELSP RETRAINED WITH 940 HASHTAGGED PUBLIC CONTENT ===
19
+ model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnet18_swsl')
20
+ # model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnet50_swsl')
21
+ # model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnext50_32x4d_swsl')
22
+ # model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnext101_32x4d_swsl')
23
+ # model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnext101_32x8d_swsl')
24
+ # model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnext101_32x16d_swsl')
25
+ # ================= SEMI-SUPERVISED MODELS PRETRAINED WITH YFCC100M ==================
26
+ # model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnet18_ssl')
27
+ # model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnet50_ssl')
28
+ # model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnext50_32x4d_ssl')
29
+ # model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnext101_32x4d_ssl')
30
+ # model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnext101_32x8d_ssl')
31
+ # model = torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnext101_32x16d_ssl')
32
 
33
  io1 = gr.Interface.load('huggingface/osanseviero/BigGAN-deep-128')
34
  io2 = gr.Interface.load('huggingface/osanseviero/BigGAN-deep-128')
35
+ #io3 = gr.Interface.load('vqgan_imagenet_f16_16384')
36
+ io3 = gr.Interface.load(model)
37
  #io3 = gr.Interface.load("huggingface/emilyalsentzer/Bio_Discharge_Summary_BERT")
38
  #io3 = gr.Interface.load("huggingface/google/pegasus-pubmed")
39
  #io3 = gr.Interface.load("huggingface/tennessejoyce/titlewave-t5-base")