-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
196 lines (157 loc) Β· 5.87 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
from setuptools import setup, find_packages
import codecs
import os
VERSION = '1.0.2'
DESCRIPTION = 'A Python library for every Computer Vision Engineer'
LONG_DESCRIPTION = """
# CvPal πΌοΈ
<div align="center">
![CvPal Logo](assets/image.png)
[![PyPI version](https://badge.fury.io/py/cvpal.svg)](https://badge.fury.io/py/cvpal)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1D_MNu3Z4lQYErs3wdYbsG4GVOU-p2ywF?usp=sharing)
[![Documentation](https://img.shields.io/badge/Documentation-π-blue)](https://github.com/Muhamed555/CvPal/tree/main/documentation)
</div>
## π Introduction
Welcome to **CvPal** - Your Ultimate Computer Vision Companion! π
**CvPal** is a cutting-edge Python package designed to empower Computer Vision engineers worldwide. Our mission is to streamline image operations, dataset management, and synthetic data generation, allowing you to focus on what truly matters: building and optimizing your machine learning pipelines.
π **Proudly Sponsored by VisionFullSpace** π
## π― Features
- πΌοΈ **Synthetic Image Generation**: Create custom datasets using text prompts
- π **Dataset Merging**: Seamlessly combine datasets with multiple attributes
- ποΈ **Label Management**: Effortlessly remove or replace specific labels from your dataset
- π **Label Occurrence Counting**: Accurately track label frequencies
- π **Dataset Reporting**: Generate comprehensive reports on your dataset
- π **Easy Integration**: Smoothly integrate with existing ML pipelines
- π **Comprehensive Documentation**: Detailed guides for all features
- π€ **AI-Powered Dataset Creation**: Generate entire datasets with just a prompt
- πΌ **Pandas Integration**: Group images and labels into a pandas DataFrame for advanced manipulation
## π Dataset Folder Structure
For optimal performance, please structure your dataset folder as follows:
```
folder/
βββ train/
β βββ images/
β βββ labels/
βββ test/
β βββ images/
β βββ labels/
βββ valid/
βββ images/
βββ labels/
```
For TXT format datasets, include a `data.yaml` config file:
```
folder/
βββ data.yaml
```
Example `data.yaml`:
```yaml
names:
- Old_Paper
- Rock
- Scissors
nc: 3
roboflow:
license: Private
project: rock-paper-scissors-sxsw
url: https://universe.roboflow.com/roboflow-58fyf/rock-paper-scissors-sxsw/dataset/14
version: 14
workspace: roboflow-58fyf
test: ../test/images
train: Rock-Paper-Scissors-SXSW-14/train/images
val: Rock-Paper-Scissors-SXSW-14/valid/images
```
## π Installation
Install CvPal with a simple pip command:
```bash
pip install cvpal==1.0.2
```
## π§ Example Usage
```python
from cvpal.generate import DetectionDataset
from cvpal.preprocessing import ImagesDetection
# Generate synthetic data
detection_dataset = DetectionDataset(model="stable-diffusion")
detection_dataset.generate("a cat looking at the camera", num_images=2, labels=["cat"], output_type="yolo", overwrite=False)
# Preprocess existing dataset
cp = ImagesDetection()
cp.read_data("/content/Rock-Paper-Scissors-SXSW-14", data_type="txt")
cp.report()
```
## π Supported Models and Formats
| Model Name | Supported Format | Support in Package | Detection | Segmentation |
|-----------------------------|------------------|---------------------|-----------|--------------|
| YOLOv5-v11 | TXT & YAML config | β
| β
| β
|
| YOLOv3-v4 | Darknet TXT | β | β | β |
| EfficientDet | Pytorch JSON annotations | β | β | β |
| Detectron 2 | JSON annotations | β | β | β |
| Segmentation Models | XML format | β | β | β |
| TensorFlow Object Detection | Binary format | β | β | β |
| Fine-tune PaliGemma | JSONL annotations | β | β | β |
| Apple's CreateML | Proprietary JSON format | β | β | β |
| Turi Create tools | Proprietary JSON format | β | β | β |
## π€ Call for Contributions
Join the CvPal community and make a global impact! We welcome contributions of all sizes:
- π Bug fixes and enhancements
- π Documentation improvements
- π¨ UI/UX enhancements
- π§ͺ New feature development
To contribute major changes, please reach out through our mailing list first.
Other ways to contribute:
- π Help triage issues
- π Create tutorials and presentations
- π΅οΈ Review pull requests
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE.txt) file for details.
---
<div align="center">
<strong>Powered by VisionFullSpace</strong><br>
Empowering Computer Vision Worldwide
</div>
"""
# Setting up
setup(
name="cvpal",
version=VERSION,
author="Mohamed E. Ibrahim",
author_email="[email protected]",
description=DESCRIPTION,
long_description_content_type="text/markdown",
long_description=LONG_DESCRIPTION,
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=[
'pandas',
'pyaml',
'PyYAML',
'python-dateutil',
'numpy',
'diffusers',
'matplotlib',
'pillow',
'torch',
'openai',
'tzdata',
'six'
],
keywords=[
'python',
'computer vision',
'cv',
'Data Reformatting',
'YOLO',
'Roboflow',
'ultralytics',
'Data preprocessing'
],
classifiers=[
"Development Status :: 1 - Planning",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Operating System :: Unix",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
]
)