Skip to main content

Week 2

June 15, 2023

  • Port forwarding from remote machine
ssh -N -f -L localhost:YYYY:localhost:XXXX remoteuser@remotehost

June 13, 2023

Meeting with Deven / Sudhir

Methods for writing data to SQLite DBs:

  1. Django
  2. Directly with pandas to_SQL (U and D are difficult)
    • Requires a SQLAlchemy engine or SQLite3 connection
  3. Using raw SQL queries through a SQLite3 connection (using python SQLite library)
    • For a code example, look at the cctv_apps project

We decided to go with pandas to_SQL method and we union the columns of the different csv files into tables named after video_group (e.g. 05052020_frames where 05052020 is the video_group name)

June 12, 2023

Meeting with Sudhir/Deven

  1. For gqc-utils-python repo, we stick to working on the main branch and only make necessary changes in colab branch.

June 09, 2023

Test design for identifying distance gaps and comparing with results based on single frame OCR

Goal of this test is to,

  1. Obtain the frames having blank distance values assigned (gap frames)
  2. Rerun those frames through a modified OCR pipeline where individual frames will be sent to Azure.
  3. Compare the extracted (and filtered) distance output from the new method with the result in 1.

Design

note

Update: 06/09/2023 After reviewing some of the output, Sudhir decided NOT to move forward with this experiment and use the stitched frames based OCR method as before on the pipeline.

note
  • At the moment, we have the OCR results from the stitched frames based method. Will be defining the design based on the next steps required.
  • This experiment will be done on a single video-group
  1. Obtain the distance gaps and a list of corresponding frames
    1. Separate the label extraction notebook to distance extraction and defect extraction notebooks. We will only be focusing on distance extraction in the following steps.
    2. Update the label extraction notebook to work with the new video-types identified during streamlit apps based classification process. (We can make a modification in the notebook to bypass that for this experiment. But I'll go ahead and implement it anyway as it is needed to identify the defect codes)
    3. Extract distances using label extraction notebook.
    4. Create and run a notebook to find frame-ids from the set of output csv files from label extraction output for rows having blank distance values. Let's call the output list as gap frame list and will be saved as Experiments/Gap_Frame_Lists/<video_group>.csv.
    5. Modify the distance post processing notebook to generate and save plots, distance vs. frame index, for each video for both the output from the label extraction and output after post processing. Also it should create a distance_extraction_statistics csv file which contains video_id, gap frame count and total frame count. Post processing notebook generates the filtered output (anomalies removed and gaps filled with interpolation/extrapolation).
      1. Statistics - gap frames, total frames across all videos
      2. Plots - no plots
  2. Rerun the gap frames through Azure OCR on a per frame basis.
    1. Make sure to use Barbara's Azure API keys.
    2. Create a modified version of current Azure OCR notebook in MSI machine (/home/gqc/git/gqc/gqc-utility-notebooks/nbs/cctv/colab-cctv-full-frame-stitch-and-Azure-OCR.ipynb) to skip the image stitching part and read the corresponding frames from gap frame list instead of all frames of the video-group. The output JSON files will be written to Experiments/Gap_Frame_JSON/<video_group>/ folder.
    3. Create a notebook to update the existing OCR results with the new JSON files obtained in the previous step which should do the following,
      1. extract the JSON zip files containing the results from stitched frames based OCR into Experiments/Temp/<video_group>/ folder.
      2. Overwrite the JSON files in this folder from the JSON files from Experiments/Gap_Frame_JSON/<video_group>/
      3. Create zip of the overwritten JSON folder and place it as Experiments/Enhanced_JSON/JSON_<video_group>.zip
  3. Generate the results and compare the outputs.
    1. Create a backup of the label extraction and distance filtering outputs which used the results from stitched frames based Azure OCR.
    2. Rerun the label extraction notebook with the Azure JSON ZIP path set to Experiments/Enhanced_JSON/JSON_<video_group>.zip.
    3. Create a backup of the plots and distance_extraction_statistics generated using distance post processing notebook version created in 1.4, and rerun it on the new data to generate the filtered output and the corresponding plots+statistics.
    4. Compare the resultant plots and the distance_extraction_statistics csv files from the two runs.