For installation:
The installation of the exampler software implementation
In a terminal of Ubuntu system, cd to exampler_software_implementation directory and run "bash install.sh"
Just wait and a virtual environment will be built automatically.
After that, please install the VTM. 
In this exampler, VTM-12.0 is downloaded in exampler_software_implementation directory as "VVCSoftware_VTM-VTM-12.0" and compiled.
If the directory name of VTM is a different one, please modify the directory name in "encoder_main.py" and "decoder_main.py" accordingly. 


For usage:
The main functions for encoder and decoder are "encoder_main.py" and "decoder_main.py" respectively. 
Examples for the encoding and decoding for various test datasets are also given in Scripts folder. 
Specifically, encoder/decoder_{sfu/tvd_detseg/tvd_tracking} are the prepared scripts for the encoding and decoding of SHU-HW, TVD Image and TVD Video respectively. 
Please modify the "data_dir" parameter in the encoder scripts according to specific storage location. 
Moreover, the "cuda_devices", "processes_per_gpu" and "cpu_per_gpu_process" can be adjusted based on the specific platform conditions.

For encoding and decoding file structure:
The file structure example during the encoding and decoding process, for both input is video in YUV format and image in PNG format.
For YUV input, the example is for SFU-HW; for PNG input, the example is for TVD image dataset.

base_folder: The basic folder for all the test results across datasets and configs.
test_id: Test name, for example, TVD_tracking_RA indicates the TVD Video dataset under RA config.
output_dir= base_folder/test_id: All the outputs during encoding and decoding
based on the output_dir

For input YUV video
encoding file structure 
  temp
    qp+str(qp_idx)
      seq_name_full
        log_enc.txt (record encoding time)
        spa_enc
          seq_name_full.yuv (downsampled)
        stream_enc
          seq_name_full.log (vtm encoding log)
          seq_name_full_video.bin (vtm encoder bitstream)
          seq_name_full.yuv (vtm encoder reconstruction)
          data_spa.txt (spatial downsampling params)
  bitstream
    qp+str(qp_idx)
      seq_name_full.bin (ultimate bitstream file in encoding)

decoding file structure 
  temp 
    qp+str(qp_idx)
      seq_name_full
        log_dec.txt (record decoding time)
        stream_dec
          seq_name_full_video.bin (unzip from bin file)
          data_spa.txt (unzip from bin file)
          seq_name_full.log (vtm decoding log)
          seq_name_full_video.yuv (vtm decoder reconstruction)
        spa_dec
          seq_name_full.yuv (upsampled reconstructed yuv file)
  recon
    qp+str(qp_idx)
      seq_name_full.yuv (ultimate reconstructed yuv file in decoding)

For input PNG image
encoding file structure
  temp
    qp+str(qp_idx)
      seq_name_full
        log_enc.txt (record encoding time)
        spa_enc
          seq_name_full.yuv (downsampled)
        stream_enc
          seq_name_full.log (vtm encoding log)
          seq_name_full_video.bin (vtm encoder bitstream)
          seq_name_full.yuv (vtm encoder reconstruction)
          data_spa.txt (spatial downsampling params)
  bitstream
    qp+str(qp_idx)
      seq_name_full.bin (ultimate bitstream file in encoding)

decoding file structure
  temp
    qp+str(qp_idx)
      seq_name_full
        log_dec.txt
        stream_dec
          seq_name_full_video.bin (unzip from bin file)
          data_spa.txt (unzip from bin file)
          seq_name_full.log (vtm decoding log)
          seq_name_full_video.yuv (vtm decoder reconstruction)
        spa_dec
          seq_name_full.png (upsampled reconstructed png file)
  recon
    qp+str(qp_idx)
      seq_name_full.png (ultimate reconstructed png file in decoding)
      
For any questions, please feel free to contact Shurun Wang via "shurun.wsr@alibaba-inc.com". 
          