kenobi commited on
Commit
909faa5
1 Parent(s): b167c41

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -6
README.md CHANGED
@@ -48,11 +48,11 @@ Additional images for testing can be found at:
48
 
49
  #### High_Energy_Ion_Fe_Nuclei
50
 
51
- ![High_Energy_Ion_Fe_Nuclei](images/High_Energy_Ion_Fe_Nuclei)
52
 
53
  #### XRay_irradiated_Nuclei
54
 
55
- ![XRay_irradiated_Nuclei](images/XRay_irradiated_Nuclei)
56
 
57
  ## Training data
58
  The ViT model was pretrained on a dataset consisting of 14 million images and 21k classes ([ImageNet-21k](http://www.image-net.org/).
@@ -67,16 +67,16 @@ from transformers import AutoFeatureExtractor, AutoModelForImageClassification
67
  from PIL import Image
68
  import requests
69
 
70
- url = 'https://sdo.gsfc.nasa.gov/assets/gallery/preview/211_coronalhole.jpg'
71
  image = Image.open(requests.get(url, stream=True).raw)
72
 
73
- feature_extractor = AutoFeatureExtractor.from_pretrained("kenobi/SDO_VT1")
74
- model = AutoModelForImageClassification.from_pretrained("kenobi/SDO_VT1")
75
  inputs = feature_extractor(images=image, return_tensors="pt")
76
 
77
  outputs = model(**inputs)
78
  logits = outputs.logits
79
- # model predicts one of the three fine-tuned classes (NASA_SDO_Coronal_Hole, NASA_SDO_Coronal_Loop or NASA_SDO_Solar_Flare)
80
  predicted_class_idx = logits.argmax(-1).item()
81
  print("Predicted class:", model.config.id2label[predicted_class_idx])
82
  ```
 
48
 
49
  #### High_Energy_Ion_Fe_Nuclei
50
 
51
+ ![High_Energy_Ion_Fe_Nuclei](https://roosevelt.devron-systems.com/HF/P242_73665006707-A6_002_008_proj.tif)
52
 
53
  #### XRay_irradiated_Nuclei
54
 
55
+ ![XRay_irradiated_Nuclei](https://roosevelt.devron-systems.com/HF/P278_73668090728-A7_003_027_proj.tif)
56
 
57
  ## Training data
58
  The ViT model was pretrained on a dataset consisting of 14 million images and 21k classes ([ImageNet-21k](http://www.image-net.org/).
 
67
  from PIL import Image
68
  import requests
69
 
70
+ url = 'https://roosevelt.devron-systems.com/HF/P242_73665006707-A6_002_008_proj.tif'
71
  image = Image.open(requests.get(url, stream=True).raw)
72
 
73
+ feature_extractor = AutoFeatureExtractor.from_pretrained("kenobi/NASA_GeneLab_MBT")
74
+ model = AutoModelForImageClassification.from_pretrained("kenobi/NASA_GeneLab_MBT")
75
  inputs = feature_extractor(images=image, return_tensors="pt")
76
 
77
  outputs = model(**inputs)
78
  logits = outputs.logits
79
+ # model predicts one of the two fine-tuned classes (High_Energy_Ion_Fe_Nuclei or XRay_irradiated_Nuclei)
80
  predicted_class_idx = logits.argmax(-1).item()
81
  print("Predicted class:", model.config.id2label[predicted_class_idx])
82
  ```