Convert the scripts into a worker
Depends #5 (closed) #6 (closed) #7 (closed) #10 (closed)
Now that we have all the code needed, we can create a worker, similar to UFCNTrain. Create a new class PylaiaTrain(BaseWorker, TrainingMixin)
in worker/train.py
with the following structure:
-
configure
: mostly the same as what's been done with U-FCN up to the additional attributes definition (is_gpu_available
, etc...) -
get_model_creation_config
: method created in #5 (closed), currently hard-coded -
get_model_training_config
: method created in #6 (closed), currently hard-coded -
retrieve_line_image
: method created in #7 (closed), with the base-worker optimizations -
process_line
: method created in #7 (closed) -
generate_training_dataset
: method created in #7 (closed), will process on step ('train', 'val'), similar to build_dataset for U-FCN -
build_training_dataset
: will callgenerate_training_dataset
for each step, similar to build_training_dataset for U-FCN -
generate_syms
: method created in #10 (closed) -
run
- mktmpdir()
- build_training_dataset()
- Train folder
- generate_training_dataset -> creates train.txt and corresponding images
- Val folder
- generate_training_dataset -> creates val.txt and corresponding images
- Train folder
- generate_syms() -> syms.txt
- get_model_creation_config
- create_model # call to create_pylaia_model
- get_model_training_config
- train_model # call to train_pylaia_model
- publish_model_version