|
a |
|
b/README.md |
|
|
1 |
# PathologyGo |
|
|
2 |
Core components of PathologyGo, the AI assistance system designed for histopathological inference. |
|
|
3 |
|
|
|
4 |
<b>Dependency</b> |
|
|
5 |
|
|
|
6 |
* Docker |
|
|
7 |
* Python 2.7 and 3.x |
|
|
8 |
* openslide |
|
|
9 |
* tensorflow_serving |
|
|
10 |
* grpc |
|
|
11 |
* pillow |
|
|
12 |
* numpy |
|
|
13 |
* opencv-python |
|
|
14 |
|
|
|
15 |
<b>Dockerized TensorFlow Serving</b> |
|
|
16 |
|
|
|
17 |
* GPU version: [GitHub](https://github.com/physicso/tensorflow_serving_gpu), [Docker Hub](https://hub.docker.com/r/physicso/tf_serving_gpu). |
|
|
18 |
* CPU version: [Docker Hub](https://hub.docker.com/r/tensorflow/serving). |
|
|
19 |
|
|
|
20 |
<b>Quick Start</b> |
|
|
21 |
|
|
|
22 |
This code is easy to implement. Just change the path to your data repo: |
|
|
23 |
|
|
|
24 |
```python |
|
|
25 |
from utils import config |
|
|
26 |
GPU_LIST = config.INFERENCE_GPUS |
|
|
27 |
import os |
|
|
28 |
os.environ["CUDA_VISIBLE_DEVICES"] = ','.join('{0}'.format(n) for n in GPU_LIST) |
|
|
29 |
from inference import Inference |
|
|
30 |
|
|
|
31 |
|
|
|
32 |
if __name__ == '__main__': |
|
|
33 |
pg = Inference(data_dir='/path/to/data/', data_list='/path/to/list', |
|
|
34 |
class_num=2, result_dir='./result', use_level=1) |
|
|
35 |
pg.run() |
|
|
36 |
|
|
|
37 |
``` |
|
|
38 |
|
|
|
39 |
You may configure all the model-specific parameters in `utils/config.py`. |
|
|
40 |
|
|
|
41 |
<b>Example</b> |
|
|
42 |
|
|
|
43 |
Use the [CAMELYON16](https://camelyon16.grand-challenge.org/) test dataset as an example, |
|
|
44 |
the data path should be `/data/CAMELYON/`, and the content of the data list is |
|
|
45 |
|
|
|
46 |
``` |
|
|
47 |
001.tif |
|
|
48 |
002.tif |
|
|
49 |
... |
|
|
50 |
``` |
|
|
51 |
|
|
|
52 |
The predicted heatmaps will be written to `./result`. |
|
|
53 |
|
|
|
54 |
<b>DIY Notes</b> |
|
|
55 |
|
|
|
56 |
You may use other exported models. You can change the model name for TensorFlow Serving in `utils/config.py`. Just remember to modify `class_num` and `use_level`. |
|
|
57 |
|
|
|
58 |
Note that the default input / output tensor name should be `input` / `output`. |