File size: 1,803 Bytes
d16b52d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
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
66
67
68
69
70
from typing import Literal, Optional

from setuptools import find_packages, setup


deps = [
    "diffusers==0.25.0",
    "transformers",
    "accelerate",
    "fire",
    "einops",
    "omegaconf",
    "imageio",
    "timm==0.6.7",
    "lightning",
    "peft",
    "av",
    "decord",
    "pillow",
    "pywin32;sys_platform == 'win32'",
]


def get_cuda_version_from_torch() -> Optional[Literal["11", "12"]]:
    try:
        import torch

        return torch.version.cuda.split(".")[0]
    except ImportError:
        raise ImportError("Please install PyTorch first. See https://pytorch.org/get-started/locally/.")


cu = get_cuda_version_from_torch()

assert cu in ["11", "12"], f"Unsupported CUDA version: {cu}"

deps_tensorrt = [
    "onnx==1.16.0",
    "onnxruntime==1.16.3",
    "protobuf==5.27.0",
    "polygraphy",
    "onnx-graphsurgeon",
    "cuda-python",
    f"tensorrt_cu{cu}_libs==10.0.1",
    f"tensorrt_cu{cu}_bindings==10.0.1",
    "tensorrt==10.0.1",
    "colored",
]
extras = {"tensorrt": deps_tensorrt}


if __name__ == "__main__":
    setup(
        name="Live2Diff",
        version="0.1",
        description="real-time interactive video translation pipeline",
        long_description=open("README.md", "r", encoding="utf-8").read(),
        long_description_content_type="text/markdown",
        keywords="deep learning diffusion pytorch stable diffusion streamdiffusion real-time next-frame prediction",
        license="Apache 2.0 License",
        author="leo",
        author_email="[email protected]",
        url="https://github.com/LeoXing1996/NextFramePredictionPreview",
        package_dir={"": "live2diff"},
        packages=find_packages("live2diff"),
        python_requires=">=3.10.0",
        install_requires=deps,
        extras_require=extras,
    )