add reuse instructions
Browse files
README.md
CHANGED
@@ -29,6 +29,19 @@ The following TCGA studies were used in training: ACC, BLCA, BRCA, CESC, COADREA
|
|
29 |
|
30 |
The following TCGA studies were not used in training: CHOL, UVM, UCS, KICH, MESO, DLBC.
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
## Model performance
|
34 |
|
|
|
29 |
|
30 |
The following TCGA studies were not used in training: CHOL, UVM, UCS, KICH, MESO, DLBC.
|
31 |
|
32 |
+
## Reusing this model
|
33 |
+
|
34 |
+
To use this model on the command line, see [WSInfer-MIL](https://github.com/kaczmarj/wsinfer-mil).
|
35 |
+
|
36 |
+
Alternatively, you may use PyTorch on ONNX to run the model. First, embed 128um x 128um patches using CTransPath. Then pass the bag of embeddings to the model.
|
37 |
+
|
38 |
+
```python
|
39 |
+
import onnxruntime as ort
|
40 |
+
import numpy as np
|
41 |
+
embedding = np.ones((1_000, 768), dtype="float32")
|
42 |
+
ort_sess = ort.InferenceSession("model.onnx")
|
43 |
+
logits, attention = ort_sess.run(["logits", "attention"], {'input': embedding})
|
44 |
+
```
|
45 |
|
46 |
## Model performance
|
47 |
|