oohtmeel commited on
Commit
6c6cf58
1 Parent(s): 4072f20

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -23
README.md CHANGED
@@ -6,8 +6,8 @@ tags:
6
  ---
7
  ## Model Details
8
 
9
- This model is trained on 224X224 Grayscale images which are CT-scans
10
- that are transformed into JPEG. The model is a finetuned version of
11
  [Swin Transformer (tiny-sized model)](https://huggingface.co/microsoft/swin-tiny-patch4-window7-224).
12
  I also used this tutorial.[Swin Transformer (tiny-sized model)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb#scrollTo=UX6dwmT7GP91).
13
 
@@ -15,7 +15,7 @@ I also used this tutorial.[Swin Transformer (tiny-sized model)](https://colab.re
15
 
16
  ## Uses
17
 
18
- The model can be used to classify JPEG images of CT scans into either cancer positive or
19
  Cancer negative groups.
20
  I think it would work okay for any image classification task.
21
 
@@ -30,24 +30,7 @@ some of which contained Cancerous Nodules and some that did not.
30
 
31
 
32
  ## How to Use
33
- ```python
34
-
35
- from huggingface_hub import hf_hub_download
36
- from PIL import Image
37
-
38
- abc= hf_hub_download(repo_id="oohtmeel/swin-tiny-patch4-finetuned-lung-cancer-ct-scans",
39
- filename="_X000a109d-56da-4c3f-8680-55afa04d6ae0.dcm.jpg.jpg")
40
- image = Image.open(abc)
41
- processor = AutoImageProcessor.from_pretrained("oohtmeel/swin-tiny-patch4-finetuned-lung-cancer-ct-scans")
42
- model = AutoModelForImageClassification.from_pretrained("oohtmeel/swin-tiny-patch4-finetuned-lung-cancer-ct-scans")
43
- inputs = processor(images=image, return_tensors="pt")
44
- outputs = model(**inputs)
45
- logits = outputs.logits
46
- predicted_class_idx = logits.argmax(-1).item()
47
- print("Predicted class:", model.config.id2label[predicted_class_idx])
48
-
49
- ```
50
-
51
-
52
- Or you can load a grayscale JPG lung cancer image into the model inference section and it will attempt to identify it.
53
 
 
 
 
 
6
  ---
7
  ## Model Details
8
 
9
+ This model is trained on 224X224 Grayscale images which were originally CT-scans
10
+ that were transformed into JPG images. The model is a finetuned version of
11
  [Swin Transformer (tiny-sized model)](https://huggingface.co/microsoft/swin-tiny-patch4-window7-224).
12
  I also used this tutorial.[Swin Transformer (tiny-sized model)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb#scrollTo=UX6dwmT7GP91).
13
 
 
15
 
16
  ## Uses
17
 
18
+ The model can be used to classify JPG images of CT scans into either cancer positive or
19
  Cancer negative groups.
20
  I think it would work okay for any image classification task.
21
 
 
30
 
31
 
32
  ## How to Use
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
+ Upload a grayscale JPG into the model inference section and it will cast a prediction.
35
+ One comes included in this repo. If the image contains an X, it is a negative cancer image.
36
+ If an image name contains a Y it is positive.