Skip to content

Commit 4bfc7f3

Browse files
author
Mayank
committed
initial
0 parents  commit 4bfc7f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+9883
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Dataset
2+
Recognition
3+
Dataset
4+
Exp
5+
Misc
6+
*.pyc

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM python:3
2+
3+
ADD requirements.txt /
4+
RUN pip install -r requirements.txt
5+
RUN pip install git+https://github.com/yaml/pyyaml.git
6+
7+
ADD main.py /
8+
COPY configs /configs
9+
COPY src /src
10+
RUN mkdir Exp
11+
12+
ENTRYPOINT [ "python", "./main.py" ]

Errors_got.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TypeError: 'ScannerError' object is not subscriptable - When the configs/config.yaml file has some error

ReadMe.md

Whitespace-only changes.

Readme.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#AIM -
2+
3+
*GUIDELINES TO BE FOLLOWED WHILE WRITING A PROGRAM
4+
*NEVER REPEAT A SINGLE LINE OF CODE*
5+
*EXTENSIVELY MAKE USE OF HIERARCHY, CLASSES AND FUNCTIONS*
6+
7+
#Naming -
8+
9+
All class names should follow "CamelHump" naming style
10+
All file name should follow "this_naming_style"
11+
All function name should follow "verySimilarToCamelHump" style
12+
13+
#Documentation -
14+
15+
Every project should contain the Readme.md file describing the Aim of the project and how to run the program instructions
16+
Every function should have a 1-2 line description of every input argument and output argument
17+
There should be a 3-4 line description of what the function does
18+
There should be a "requirements.txt" file which contains all the packages used as well as their version
19+
20+
#Pipeline -
21+
22+
All programs will be stored in the "src" folder
23+
All constants related to your program will be stored in "config/congif.yaml" file following the yaml style of writing
24+
There would be only one "main.py" file which will be used to drive all the other functions
25+
26+
#Experiment Folder -
27+
28+
All files of the current run should be stored in the "Exp" directory whose path will be given in the "config/config.yaml" file.
29+
If the Experiment folder already exists, user should be given a choice to rename the older folder or to replace it.
30+
31+
#Logger -
32+
33+
There should be a logger function which stores the time-stamp of each output in the file "Exp/log.txt". It should also print the output on the console screen
34+
35+
#Saving Work -
36+
37+
The "work" should be saved such that worst case scenario only 5 mins of work is lost.
38+
*Care should be taken not to store the "work" too often which would cause harddisk overload*
39+
40+
#BitBucket -
41+
42+
All codes should be kept uploaded on bitbucket. Everyone should be familiar with the basics of git.
43+
44+
#Misc -
45+
46+
All the other "things" which has not been mentioned in the pipeline can be kept in the folder misc

configs/config.yaml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
#Yaml file to define hyperparametrs, and to define location of data
2+
project: Text_Detection
3+
4+
name: UNet_Resnet_50 # UNet #
5+
6+
dataloader: Own
7+
aspect_resize: 1-0.5-2 # constant # 1-0.5-2 # scale_two
8+
9+
hard_negative_mining: True
10+
class_weight: [0.2, 0.8]
11+
link: True
12+
weight_bbox: True
13+
gradient: False
14+
n_channels: 3
15+
16+
Profiler:
17+
reset: True
18+
19+
ratio: 3
20+
weight_threshold: 0.7
21+
min_bg: 1000
22+
sed_link: 2
23+
pos_neg: 2
24+
25+
26+
max_size: 512 # For 32_2 aspect resize in dataloader
27+
# image_size: 256 # For Square dataloader
28+
29+
# ensemble:
30+
# 1: Exp/All_results/Best_overall_result
31+
# # 2: Exp/All_results/Best_Patches
32+
# 3: Exp/All_results/Best_Spots
33+
# # 4: Exp/All_results/Best_Wrinkle
34+
# ensemble_way: max_voting # avg_voting
35+
36+
target_transform: False
37+
retrain: True
38+
39+
# Logging
40+
41+
accuracy_log: 100
42+
show_some: 100
43+
log_interval_steps: 500
44+
test_now: 500
45+
update_config: 10
46+
save_test_image: 100
47+
48+
# Parameters
49+
50+
lr:
51+
1: 0.000005
52+
100: 0.000005
53+
5000: 0.000005
54+
8000: 0.000005
55+
56+
momentum: 0.9
57+
weight_decay: 5.0e-4
58+
59+
optimizer: Adam
60+
optimizer_new: False #If want to refresh the optimizer parameters(Like when shifting optimizers from Adam to SGD or vice versa)
61+
lossf: CEL
62+
weighted_lossf_parameter : 0.5
63+
depth: 5
64+
65+
cuda: True
66+
seed: 2
67+
68+
steps: 25000
69+
70+
PreTrained_net: True
71+
72+
PreTrained_model:
73+
74+
while_testing: True
75+
check: True
76+
77+
checkpoint: /home/mayank/Desktop/GitRepos/text/Exp/Detection/Models_Best/0_checkpoint.pth.tar
78+
checkpoint_info: /home/mayank/Desktop/GitRepos/text/Exp/Detection/Models_Best/0_info_checkpoint.pth.tar
79+
80+
checkpoint_best: /home/mayank/Desktop/GitRepos/text/Exp/Detection/Models_Best/0_checkpoint.pth.tar
81+
checkpoint_best_info: /home/mayank/Desktop/GitRepos/text/Exp/Detection/Models_Best/0_info_checkpoint.pth.tar
82+
83+
aug_flag: True
84+
85+
augmentation:
86+
87+
brightness: 0.1
88+
contrast: 0.1
89+
saturation: 0.1
90+
hue: 0.1
91+
rotation: [0.8, 0.07, 0.07, 0.06]
92+
crop_range: [0.1,1]
93+
grey_scale: 0.1
94+
intensity:
95+
prob: 0.5
96+
max: 1.6
97+
min: 0.4
98+
blur:
99+
prob: 0.1
100+
divide: 800
101+
invert: 0.1
102+
random_channel_shift: 0.2
103+
104+
dir:
105+
# Test_one: Exp/test_one_images
106+
Exp: Exp/Detection
107+
Profiler: Exp/Detection/Profiler
108+
# Output: Exp/Temporary
109+
# Output_Best: Exp/Best
110+
Model_Output: Exp/Detection/Models
111+
Model_Output_Best: Exp/Detection/Models_Best
112+
# Model_Output: /media/mayank/0b40607e-7efc-4216-b12f-8bb86facfaed/Text/Models
113+
# Model_Output_Best: /media/mayank/0b40607e-7efc-4216-b12f-8bb86facfaed/Text/Models_Best
114+
# Ensemble_Output: Exp/Ensemble_Output
115+
Plots: Exp/Detection/Plots
116+
Test_sample: Exp/Detection/Output_Test
117+
Train_sample: Exp/Detection/Output_Train
118+
119+
test_one:
120+
transform: False
121+
batch_size: 5
122+
cpu_alloc: 1
123+
Type: test_one
124+
loader:
125+
flag: False
126+
# dir: /home/Common/Mayank/Text/test_one_images
127+
dir: Exp/Detection/test_one_images
128+
129+
train:
130+
transform: True
131+
batch_size: 1
132+
cpu_alloc: 1
133+
Type: train
134+
loader:
135+
flag: False
136+
137+
test:
138+
transform: False
139+
batch_size: 1
140+
cpu_alloc: 1
141+
Type: test
142+
loader:
143+
flag: False

configs/dataset.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
dataset_train: [OWN]
2+
dataset_test: [OWN]
3+
4+
seed: 2
5+
6+
cache: True
7+
cache_path: /home/Common/Datasets_SSD/Dataset_Text
8+
9+
metadata:
10+
# COCO:
11+
# dir: /home/Common/Datasets_SSD/Dataset_Text/COCO
12+
# image: /home/Common/Datasets_SSD/Dataset_Text/COCO/Images
13+
# label: /home/Common/Datasets_SSD/Dataset_Text/COCO/Labels
14+
# meta: /home/Common/Datasets_SSD/Dataset_Text/COCO/Meta
15+
# contour_length_thresh_min: 10
16+
# contour_area_thresh_min: 300
17+
# segmentation_thresh: 0.7
18+
# link_thresh: 0.7
19+
# background_all: False
20+
# cal_avg: False
21+
# split_type: '0.8' #orig
22+
IC13:
23+
dir: /home/Common/Datasets_SSD/Dataset_Text/IC13
24+
image: /home/Common/Datasets_SSD/Dataset_Text/IC13/Images
25+
label: /home/Common/Datasets_SSD/Dataset_Text/IC13/Labels
26+
meta: /home/Common/Datasets_SSD/Dataset_Text/IC13/Meta
27+
contour_length_thresh_min: 10
28+
contour_area_thresh_min: 300
29+
segmentation_thresh: 0.7
30+
link_thresh: 0.7
31+
cal_avg: False
32+
split_type: '0.8' #orig
33+
IC15:
34+
dir: /home/Common/Datasets_SSD/Dataset_Text/IC15
35+
image: /home/Common/Datasets_SSD/Dataset_Text/IC15/Images
36+
label: /home/Common/Datasets_SSD/Dataset_Text/IC15/Labels
37+
meta: /home/Common/Datasets_SSD/Dataset_Text/IC15/Meta
38+
contour_length_thresh_min: 10
39+
contour_area_thresh_min: 300
40+
segmentation_thresh: 0.5
41+
link_thresh: 0.5
42+
cal_avg: False
43+
split_type: '0.9' #orig
44+
SYNTH:
45+
dir: /home/Common/Datasets_SSD/Dataset_Text/SYNTH
46+
image: /home/Common/Datasets_SSD/Dataset_Text/SYNTH/Images
47+
label: /home/Common/Datasets_SSD/Dataset_Text/SYNTH/Labels
48+
meta: /home/Common/Datasets_SSD/Dataset_Text/SYNTH/Meta
49+
contour_length_thresh_min: 10
50+
contour_area_thresh_min: 300
51+
segmentation_thresh: 0.7
52+
link_thresh: 0.7
53+
cal_avg: False
54+
split_type: '0.8' #orig
55+
OWN:
56+
dir: /home/Common/Datasets_SSD/Dataset_Text/OWN/CheckNeeded
57+
image: /home/Common/Datasets_SSD/Dataset_Text/OWN/CheckNeeded/Images
58+
label: /home/Common/Datasets_SSD/Dataset_Text/OWN/CheckNeeded/Labels
59+
meta: /home/Common/Datasets_SSD/Dataset_Text/OWN/CheckNeeded/Meta
60+
contour_length_thresh_min: 10
61+
contour_area_thresh_min: 300
62+
segmentation_thresh: 0.7
63+
link_thresh: 0.7
64+
cal_avg: False
65+
split_type: '0.8' #orig
66+
ART:
67+
dir: /home/Common/Datasets_SSD/Dataset_Text/ART
68+
image: /home/Common/Datasets_SSD/Dataset_Text/ART/Images
69+
label: /home/Common/Datasets_SSD/Dataset_Text/ART/Labels
70+
meta: /home/Common/Datasets_SSD/Dataset_Text/ART/Meta
71+
contour_length_thresh_min: 10
72+
contour_area_thresh_min: 300
73+
segmentation_thresh: 0.7
74+
link_thresh: 0.7
75+
cal_avg: False
76+
split_type: '0.8' #orig

0 commit comments

Comments
 (0)