README_en.md 3.8 KB
Newer Older
H
haoyuying 已提交
1 2 3 4
# SkyAR

|Module Name|SkyAR|
| :--- | :---: |
H
haoyuying 已提交
5
|Category|Video editing|
H
haoyuying 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|Network|UNet|
|Dataset|-|
|Fine-tuning supported or not|No|
|Module Size|206MB|
|Data indicators|-|
|Latest update date|2021-02-26|

## I. Basic Information 

- ### Application Effect Display

    - Sample results:
        * Input video:

            ![Input video](https://img-blog.csdnimg.cn/20210126142046572.gif)

        * Jupiter:

            ![Jupiter](https://img-blog.csdnimg.cn/20210125211435619.gif)
        * Rainy day:

            ![Rainy day](https://img-blog.csdnimg.cn/2021012521152492.gif)
        * Galaxy:

            ![Galaxy](https://img-blog.csdnimg.cn/20210125211523491.gif)
        * Ninth area spacecraft:

            ![Ninth area spacecraft](https://img-blog.csdnimg.cn/20210125211520955.gif)

        * Input video:

            ![Input video](https://img-blog.csdnimg.cn/20210126142038716.gif)
        * Floating castle:

            ![Floating castle](https://img-blog.csdnimg.cn/20210125211514997.gif)
        * Thunder and lightning:

            ![Thunder and lightning](https://img-blog.csdnimg.cn/20210125211433591.gif)

        * Super moon:
        
            ![Super moon](https://img-blog.csdnimg.cn/20210125211417524.gif)

- ### Module Introduction

    - SkyAR is based on [Castle in the Sky: Dynamic Sky Replacement and Harmonization in Videos](https://arxiv.org/abs/2010.11800). It mainly consists of three parts: sky matting network, motion estimation and image fusion.

    - For more information, please refer to:[SkyAR](https://github.com/jiupinjia/SkyAR)


## II. Installation

- ### 1、Environmental Dependence

    - paddlepaddle >= 2.0.0

    - paddlehub >= 2.0.0

- ### 2、Installation

H
haoyuying 已提交
66 67 68 69 70
    - ```shell
      $hub install SkyAR
      ```
    - In case of any problems during installation, please refer to:[Windows_Quickstart](../../../../docs/docs_en/get_start/windows_quickstart.md)
    | [Linux_Quickstart](../../../../docs/docs_en/get_start/linux_quickstart.md) | [Mac_Quickstart](../../../../docs/docs_en/get_start/mac_quickstart.md)  
H
haoyuying 已提交
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101

## III. Module API Prediction

- ### 1、Prediction Code Example

    ```python
    import paddlehub as hub

    model = hub.Module(name='SkyAR')

    model.MagicSky(
        video_path=[path to input video path],
        save_path=[path to save video path]
    )
    ```
- ### 2、API

    ```python
    def MagicSky(
            video_path, save_path, config='jupiter',
            is_rainy=False, preview_frames_num=0, is_video_sky=False, is_show=False,
            skybox_img=None, skybox_video=None, rain_cap_path=None,
            halo_effect=True, auto_light_matching=False,
            relighting_factor=0.8, recoloring_factor=0.5, skybox_center_crop=0.5
        )
    ```

    - **Parameter**

        * video_path(str):input video path.
        * save_path(str):save videp path.
H
haoyuying 已提交
102
        * config(str): SkyBox configuration, all preset configurations are as follows:  `['cloudy', 'district9ship', 'floatingcastle', 'galaxy', 'jupiter',
H
haoyuying 已提交
103
            'rainy', 'sunny', 'sunset', 'supermoon', 'thunderstorm'
H
haoyuying 已提交
104 105
        ]`, if you use a custom SkyBox, please set it to None.
    
H
haoyuying 已提交
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
        * skybox_img(str):custom SkyBox image path
        * skybox_video(str):custom SkyBox video path
        * is_video_sky(bool):customize whether SkyBox is a video
        * rain_cap_path(str):custom video path with rain
        * is_rainy(bool): whether the sky is raining
        * halo_effect(bool):whether to open halo effect
        * auto_light_matching(bool):whether to enable automatic brightness matching
        * relighting_factor(float): relighting factor
        * recoloring_factor(float): recoloring factor
        * skybox_center_crop(float):skyBox center crop factor
        * preview_frames_num(int):set the number of preview frames
        * is_show(bool):whether to preview graphically


## IV. Release Note

- 1.0.0

  First release