Week 5
Mar 03/27/23
Training with EasyOCR
The training sample given on their website how they want the labels. The model expects cropped words with their annotated labels inside a labels.csv.
That would mean that all the images that we got the text extracted from that would have to be cropped and then annotated to create the required training dataset.
The resulting csv would look something like this,
filename, words
,Freudian %
They have provided the required training scripts, this can be explored. The required links are available over here ↓
- https://github.com/JaidedAI/EasyOCR/blob/master/custom_model.md
- https://github.com/JaidedAI/EasyOCR/tree/master/trainer
TAO
Sudhir wants to explore this.
Meeting with Vannary
- Issue with weighted loss function across multiple gpus #119 (low priority)
- Runs with 692 videos
- method 1: concatenate all seperate test sets DNV, SD1, COV
- method 2: combine all: then split 80 (75-25 t&v) 20 test
- Multi-label defect classification
- DNV
- SD1
- COV
- All combined
- This is done
- Run
ND vs D- DNV
- Both runs are made for both 80 and 486 (486 also includes the previous 80) videos
- Runs synced with
wandb - Results for test
- with
fine_tune→ done - with
fit_flat_cos→ not yet
- with
- Results compiled?
- with
fine_tune→ done - with
fit_flat_cos→ not yet
- with
- COV
- not yet
- SD1
- not yet
- All combined
- blah
- DNV
- Only defect (no ND) model
- DNV
- SD1
- COV
- All combined
Issues with data validation
- Frames being mislabelled (ND images getting classified as an image containing defect)
- point1
- point2
- point3
fme-to-python
- break_value assignment remaining for:
- mod1: distance based assignment
- mod2: distance based assignment
- mod3: this is bldg_type based: layout is shared with Vannary
Mar 03/28/23
- Found some good hits for converting rst to markdown
- https://docs.readthedocs.io/en/stable/guides/migrate-rest-myst.html#how-to-convert-existing-restructuredtext-documentation-to-myst
- https://rst-to-myst.readthedocs.io/en/stable/index.html
- https://stackoverflow.com/questions/13396856/markdown-output-for-sphinx-based-documentation This was explored, results are not good
Priorities
- Concept-app
- Need to write the design up, I have the skeleton ready
- Doc on AI-tooling and others
- Document has been started need to show it to Sudhir and Jake and then I need to ask for some input on the same
Mar 03/29/23
- Training with EasyOCR
- This is done.
- Need to find the prediction rate and check the inference pipeline.
Mar 03/31/23
Possible workflow for Vannary
- Extract frames into zip files (done) (about 107 zips for 1066 wRC videos)
- Azure OCR produces text and corresponding bounding boxes (done)
- Frames are snipped from the standard extracted directory to extract the distance region in each middle-frame
- Deven is creating the app to find the distance region to snip the image using the middle frames
- Distance regions will be snipped from all extracted frames from the zip files based on the previous point. Organize the snips so that they are consistent with the extracted frames zip files (extracted snips directory - names of the zips should be identical).
- Stitch a maximum of 200 snips at a time from the same video using
ffmpegto create a single file which would be sent to Azure OCR- Find the text corresponding to each snip
- Process the text to find the distance and assign it to the corresponding frame
- Write a csv for each video for all the extracted frames (frame_id, distance)
- Group the csv files into zip files according to the original group
- Assign defects to frames based on the distance from the Access DB
For 1066 wRC videos
- Extract frames
- Azure OCR produces text and corresponding bounding boxes which is written into JSON format
- Determine bounding box which lies entirely inside the distance region and the corresponding text (needs a script to loop over JSON files)
- Frames are snipped to extract the distance region in each frame
- Use the snippets and the extracted text to train the EasyOCR model
- train + valid split for EasyOCR training
- training script + dir structure for VS to run on compute-canada