Update README.md
Browse files
README.md
CHANGED
@@ -39,6 +39,20 @@ Upload a grayscale JPG into the model inference section and it will cast a predi
|
|
39 |
Some are included in this repo. If the image contains an X, it is a negative cancer image.
|
40 |
If an image name contains a Y it is positive.
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
|
44 |
## Results
|
|
|
39 |
Some are included in this repo. If the image contains an X, it is a negative cancer image.
|
40 |
If an image name contains a Y it is positive.
|
41 |
|
42 |
+
``` Python
|
43 |
+
|
44 |
+
from huggingface_hub import hf_hub_download
|
45 |
+
from PIL import Image
|
46 |
+
|
47 |
+
abc= hf_hub_download(repo_id="oohtmeel/swin-tiny-patch4-finetuned-lung-cancer-ct-scans",
|
48 |
+
filename="_X000a109d-56da-4c3f-8680-55afa04d6ae0.dcm.jpg.jpg")
|
49 |
+
image = Image.open(abc)
|
50 |
+
processor = AutoImageProcessor.from_pretrained("oohtmeel/swin-tiny-patch4-finetuned-lung-cancer-ct-scans")
|
51 |
+
model = AutoModelForImageClassification.from_pretrained("oohtmeel/swin-tiny-patch4-finetuned-lung-cancer-ct-scans")
|
52 |
+
inputs = processor(images=image, return_tensors="pt")
|
53 |
+
outputs = model(**inputs)
|
54 |
+
|
55 |
+
```
|
56 |
|
57 |
|
58 |
## Results
|