Hannes Kuchelmeister commited on
Commit
65640bf
1 Parent(s): cb37243

add readme file to extraction folder

Browse files
Files changed (1) hide show
  1. annotation-preprocessing/README.md +48 -0
annotation-preprocessing/README.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Annotation Preprocessing
2
+
3
+ This directory contains code to extract image metadata from the database. In the first step the metadata is converted to csv files. The second step then loads the metadata and creates small tiles out of all images that contain eggs. The corresponding information about these patches is stored in a json file which cna be read by [Focus Annotator
4
+ ](https://github.com/13hannes11/focus_annotator).
5
+
6
+
7
+ ## Environment Variables
8
+
9
+ To run the preprocessing you need to create a `.env` file or set the corresponding environmental variables directly. The content of the file should be all of the following:
10
+
11
+ For step 0, fetching data from the database you need:
12
+
13
+ ```
14
+ DB_HOST=
15
+ DB_USER=
16
+ DB_PASSWORD=
17
+ DB_NAME=
18
+ ```
19
+
20
+ For step 1, cropping and extracting images with eggs you need:
21
+
22
+ ```
23
+ IMG_SIZE=75
24
+ ROOT_IN="in"
25
+ ```
26
+
27
+ The actual code can be either run in a docker-container, for that you can run `docker-compose up` inside the this directory. Make sure you edit the mount in the docker-compose to your directories:
28
+
29
+ ```yaml
30
+ volumes:
31
+ - <path to your output directory>:/usr/src/app/out:z
32
+ - <path to your input directory>:/usr/src/app/in:z
33
+ ```
34
+
35
+
36
+ Alternatively, you can manually run these python steps:
37
+
38
+ ```
39
+ python 0_fetch_from_database.py
40
+ ```
41
+
42
+ and
43
+
44
+ ```
45
+ python 1_splitting_into_patches.py
46
+ ```
47
+
48
+