forked from susheelsk/image-background-removal
-
Notifications
You must be signed in to change notification settings - Fork 275
/
setup.py
71 lines (62 loc) · 2.24 KB
/
setup.py
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
71
"""
Source url: https://github.com/OPHoperHPO/image-background-remove-tool
Author: Nikita Selin (OPHoperHPO)[https://github.com/OPHoperHPO].
License: Apache License 2.0
"""
import os
import re
from setuptools import setup, find_packages
from carvekit import version
IS_COLAB_PACKAGE = os.getenv("COLAB_PACKAGE_RELEASE", None)
def read(filename: str):
filepath = os.path.join(os.path.dirname(__file__), filename)
file = open(filepath, "r", encoding="utf-8")
return file.read()
def req_file(filename: str, folder: str = "."):
with open(os.path.join(folder, filename), encoding="utf-8") as f:
content = f.readlines()
# you may also want to remove whitespace characters
# Example: `\n` at the end of each line
if os.getenv("COLAB_PACKAGE_RELEASE") is not None:
return [re.sub("(>=.*)|(~=.*)|(==.*)|(typing.*)", "", x.strip()) for x in content]
return [x.strip() for x in content]
setup(
name="carvekit" if IS_COLAB_PACKAGE is None else "carvekit_colab",
version=version,
author="Nikita Selin (Anodev)",
author_email="farvard34@gmail.com",
description="Open-Source background removal framework",
long_description=read("README.md"),
long_description_content_type="text/markdown",
license="Apache License v2.0",
keywords=[
"ml",
"carvekit",
"background removal",
"neural networks",
"machine learning",
"remove bg",
],
url="https://github.com/OPHoperHPO/image-background-remove-tool",
packages=find_packages(),
scripts=[],
install_requires=req_file("requirements.txt"),
include_package_data=True,
zip_safe=False,
entry_points={
"console_scripts": [
"carvekit=carvekit:__main__.removebg",
],
},
python_requires=">=3.8" if IS_COLAB_PACKAGE is None else ">=3.6",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
)