Skip to content
Permalink
Branch: master
Commits on Aug 18, 2019
  1. Fix sorting pathlib objects (#353)

    Auroir authored and iperov committed Aug 18, 2019
    Fixing an issue caused by attempting to sort Path objects. Directly using `<` is unsupported between these, so `sorted()` needs a key specified. 
    
    "PurePath" objects support `>` while normal paths do not, causing the confusion. 
    https://docs.python.org/3/library/pathlib.html
Commits on Aug 17, 2019
Commits on Aug 16, 2019
  1. Formatted Model Summary (#348)

    Auroir authored and iperov committed Aug 16, 2019
    * Formatted Model Summary
    
    Aligns the model summary output using f-string formatting. The logic structure of the base class has not been changed, only the lines put into `model_summary_text`. Output width is calculated from keys & values and will scale to show a clean summary for any model/platform.
    
    GPU VRAM has been added as an output. Incorrect detection of VRAM is possible in broken environments and GPUs of different sizes can report the same name. Showing it here adds clarity for the user and for issue tickets.
    
    Concatenation changed from "\r\n" to "\n", CRLF end of lines for Windows are handled transparently so using it here caused extra blank lines in the summary txt file.
    
    **Examples:**
    Using CUDA + SAE-LIAE
    ```
    ============= Model Summary ==============
    ==                                      ==
    ==         Model name: SAE              ==
    ==                                      ==
    ==  Current iteration: 16               ==
    ==                                      ==
    ==----------- Model Options ------------==
    ==                                      ==
    ==         batch_size: 4                ==
    ==        sort_by_yaw: False            ==
    ==        random_flip: True             ==
    ==         resolution: 128              ==
    ==          face_type: f                ==
    ==         learn_mask: True             ==
    ==     optimizer_mode: 1                ==
    ==              archi: liae             ==
    ==            ae_dims: 256              ==
    ==          e_ch_dims: 42               ==
    ==          d_ch_dims: 21               ==
    == multiscale_decoder: False            ==
    ==         ca_weights: False            ==
    ==         pixel_loss: False            ==
    ==   face_style_power: 0.0              ==
    ==     bg_style_power: 0.0              ==
    ==    apply_random_ct: False            ==
    ==           clipgrad: False            ==
    ==                                      ==
    ==------------- Running On -------------==
    ==                                      ==
    ==       Device index: 0                ==
    ==               Name: GeForce GTX 1080 ==
    ==               VRAM: 8.00GB           ==
    ==                                      ==
    ==========================================
    ```
    Colab
    ```
    ========== Model Summary ==========
    ==                               ==
    ==         Model name: SAE       ==
    ==                               ==
    ==  Current iteration: 39822     ==
    ==                               ==
    ==-------- Model Options --------==
    ==                               ==
    ==         batch_size: 24        ==
    ==        sort_by_yaw: True      ==
    ==        random_flip: False     ==
    ==         resolution: 128       ==
    ==          face_type: f         ==
    ==         learn_mask: True      ==
    ==     optimizer_mode: 2         ==
    ==              archi: liae      ==
    ==            ae_dims: 222       ==
    ==          e_ch_dims: 34        ==
    ==          d_ch_dims: 16        ==
    == multiscale_decoder: True      ==
    ==         ca_weights: True      ==
    ==         pixel_loss: False     ==
    ==   face_style_power: 2.0       ==
    ==     bg_style_power: 1.5       ==
    ==    apply_random_ct: False     ==
    ==           clipgrad: True      ==
    ==                               ==
    ==--------- Running On ----------==
    ==                               ==
    ==       Device index: 0         ==
    ==               Name: Tesla K80 ==
    ==               VRAM: 11.00GB   ==
    ==                               ==
    ===================================
    ```
    Using OpenCL + H128
    ```
    =========================== Model Summary ===========================
    ==                                                                 ==
    ==        Model name: H128                                         ==
    ==                                                                 ==
    == Current iteration: 0                                            ==
    ==                                                                 ==
    ==------------------------- Model Options -------------------------==
    ==                                                                 ==
    ==        batch_size: 4                                            ==
    ==       sort_by_yaw: False                                        ==
    ==       random_flip: True                                         ==
    ==        lighter_ae: False                                        ==
    ==        pixel_loss: False                                        ==
    ==                                                                 ==
    ==-------------------------- Running On ---------------------------==
    ==                                                                 ==
    ==      Device index: 0                                            ==
    ==              Name: Advanced Micro Devices, Inc. gfx900 (OpenCL) ==
    ==              VRAM: 7.98GB                                       ==
    ==                                                                 ==
    =====================================================================
    ```
    Using CPU (output trimmed)
    ```
    ==------- Running On --------==
    ==                           ==
    ==       Using device: CPU   ==
    ==                           ==
    ===============================
    ```
    multi_gpu support is retained (output trimmed)
    ```
    ==------------- Running On -------------==
    ==                                      ==
    ==    Using multi_gpu: True             ==
    ==                                      ==
    ==       Device index: 1                ==
    ==               Name: Geforce GTX 1080 ==
    ==               VRAM: 8.00GB           ==
    ==       Device index: 2                ==
    ==               Name: Geforce GTX 1080 ==
    ==               VRAM: 8.00GB           ==
    ==                                      ==
    ==========================================
    ```
    
    Low VRAM warning (output trimmed)
    ```
    ==------------- Running On -------------==
    ==                                      ==
    ==       Device index: 0                ==
    ==               Name: Geforce GTX 1050 ==
    ==               VRAM: 2.00GB           ==
    ==                                      ==
    ==========================================
    /!\
    /!\ WARNING:
    /!\ You are using a GPU with 2GB or less VRAM. This may significantly reduce the quality of your result!
    /!\ If training does not start, close all programs and try again.
    /!\ Also you can disable Windows Aero Desktop to increase available VRAM.
    /!\
    ```
    
    * Fix indent
Commits on Aug 12, 2019
  1. Return sorted filenames in path_utils (#340)

    Auroir authored and iperov committed Aug 12, 2019
    Linux does not guarantee filenames are returned in any specific order. This leads to exporting frames in random order, sorting them here makes the export run sequentially. Other portions of the program should remain unaffected, if not behave more consistently (E.G. get_first_file_by_stem).
    
    This mostly helpful during exporting. Say you are expecting to not have faces for frames 1000-2000, during your export all the "no faces for..." messages will appear in random order. Since you are expecting to see this you ignore them. If you are also (unexpectedly) missing a face for frame 3000 you will not head the warning since it's mixed up in all the warnings that you are expecting. With this patch export runs in sequential order, you'll see the messages all in a row for frames 1000-2000, then again at 3000. The user is much more likely to see and head the warning this way.
    
    This also allows you to force stop the export midway though and have a contiguous set of frames to encode and preview.
You can’t perform that action at this time.