diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4ad7e22 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,63 @@ +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + +[build-system] +# Define the build dependencies and backend for packaging +requires = ["setuptools>=70", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +# Basic project metadata +name = "mobileclip" +version = "0.1.0" +description = "MobileCLIP" +authors = [ + {name = "Apple"} +] +readme = "README.md" # Points to README.md for long description +requires-python = ">=3.8" # Supports Python>=3.8 +keywords = ["Ultralytics", "Mobile", "CLIP", "pretrained"] # Keywords for PyPI search + +# Project classifiers for PyPI +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules" +] + +# Core package dependencies +dependencies = [ + "open-clip-torch>=2.20.0", # Open-source implementation of CLIP + "timm>=0.9.5", # PyTorch Image Models +] + +[project.optional-dependencies] +full = [ + "clip-benchmark>=1.4.0", # Benchmarking tools for CLIP models + "datasets", # Hugging Face datasets library + "torch>=2.1.0", # PyTorch deep learning framework + "torchvision>=0.16.0" # Computer vision library for PyTorch +] + +[project.urls] +# Project URLs for PyPI page +Homepage = "https://github.com/apple/ml-mobileclip" + +[tool.setuptools] +# Package discovery configuration +packages = {find = {include = ["mobileclip*"]}} # Auto-discover all mobileclip packages +include-package-data = true # Include non-Python files from MANIFEST.in + +[tool.setuptools.data-files] +# Additional data files to include in the distribution +"model-config" = ["mobileclip/configs/*"] # Model configuration files diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 81c3e8a..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -clip-benchmark>=1.4.0 -datasets -open-clip-torch>=2.20.0 -timm>=0.9.5 -torch>=2.1.0 -torchvision>=0.16.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index b36974d..0000000 --- a/setup.py +++ /dev/null @@ -1,66 +0,0 @@ -# -# For licensing see accompanying LICENSE file. -# Copyright (C) 2024 Apple Inc. All Rights Reserved. -# -import os -from codecs import open -from os import path - -from setuptools import find_packages, setup - -here = path.abspath(path.dirname(__file__)) - -with open(path.join(here, "README.md"), encoding="utf-8") as f: - long_description = f.read() - - -def _read_reqs(relpath): - fullpath = path.join(path.dirname(__file__), relpath) - with open(fullpath) as f: - return [s.strip() for s in f.readlines() if (s.strip() and not s.startswith("#"))] - - -def get_files(path, relative_to="."): - all_files = [] - for root, _dirs, files in os.walk(path, followlinks=True): - root = os.path.relpath(root, relative_to) - for file in files: - if file.endswith(".pyc"): - continue - all_files.append(os.path.join(root, file)) - return all_files - - -REQUIREMENTS = _read_reqs("requirements.txt") - -setup( - name="mobileclip", - version="0.1.0", - description="MobileCLIP", - url="https://github.com/apple/ml-mobileclip", - author="", - author_email="", - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Education", - "Intended Audience :: Science/Research", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: Artificial Intelligence", - "Topic :: Software Development", - "Topic :: Software Development :: Libraries", - "Topic :: Software Development :: Libraries :: Python Modules", - ], - # Note that this is a string of words separated by whitespace, not a list. - keywords="Mobile CLIP pretrained", - data_files=[ - ("model-config", get_files("mobileclip/configs")), - ], - packages=find_packages(include=["mobileclip*"]), - include_package_data=True, - install_requires=REQUIREMENTS, - python_requires=">=3.7", -)