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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
%global _empty_manifest_terminate_build 0
Name: python-AutoAiLib
Version: 1.1.0
Release: 1
Summary: The library that automates the silly ML things.
License: GNU GPLv3
URL: https://pypi.org/project/AutoAiLib/
Source0: https://mirrors.aliyun.com/pypi/web/packages/3e/1d/a6e70d607be8e88b01f0f5986f731f4b09b656006f5e45f22ab4988c8311/AutoAiLib-1.1.0.tar.gz
BuildArch: noarch
%description
<h1>AutoAI</h1>
<p>This repository is a compilation of scripts that I have created in my time working with machine learning. These scripts aim to automate the annoying and tedious parts of ML, allowing you to focus on what is important.
PyPi: https://pypi.org/project/AutoAILib/
</br> $ pip install autoailib </br>
This library was developed for and used with keras convolutional neural networks. They do however work with other keras models, besides image test obviously.</p>
<div class="entry">
<h1> AutoAiLib.general_tester(model path or object, labels, preprocessor)</h1>
<a href="https://youtu.be/TQisVhgUzWo"> Class Video Demo</a>
<h2> AutoAiLib.general_tester.predict_single(example)</h2>
<ul><li>example- If you have defined a preprocessor for your tester, this should comply with the preprocessor's argument. If
you have not defined a preprocessor, example must be in a form that your model will accept.</li></ul>
<h2> AutoAiLib.general_tester.predict_many(container=None, testing_folder = None, csv_dir)</h2>
<ul>
<li> container - This can be a container of test objects (any iterable). If preprocessor is defined, these objects must comply with the preprocessors parameter. Otherwise they must be in a form that your model will accept.</li>
<li> testing_dir - This can be a path to a testing folder which has sub folders of all classes. Again, must be preprocessed or have preprocessor defined.</li>
<li> csv_dir - This function compiles data into a csv folder to allow users to easily extract data from it, if not defined it will return a pandas data frame.</li>
</ul>
</div>
<div class="entry">
<h1> AutoAi.convnet_tester(model path or object, labels) </h1>
<a href="https://youtu.be/sM57JDasREk"> Class Video Demo </a>
<h2> AutoAi.image_predict(model_path, image_path, labels)</h2>
<h5> This function takes 3 arguments: a path to a keras model, a path to an image, and a list of labels.</h5>
<h5> Demo:</h5>
Given a the correct arguments, we get the following output, as well as this image saved to our model directory.
<img src="https://i.imgur.com/woiPdus.png"></img>
<h2> AutoAi.manual_test(model, testing_dir, labels) </h2>
<h5> This function tests a model given labels and testing data. It then compiles the results in a CSV file, and groups the results by class, and by correct and incorrect.</h5>
<ul>
<li> Model - Path of model that you want to test or model object.</li>
<li> Testing_dir - Path to the directory with your testing data.</li>
<li> Labels - Dictionary of the classes, in form (index:class_name)</li>
</ul>
<h5>Example csv:</h5>
<img src="https://i.imgur.com/g4gNQjS.png"></img>
</div>
<div class="entry">
<h2>Update! This has now been packaged in the AutoAI.data_compiler class.
AutoAi.data_compiler(self,src, dest, **kwargs)</br>
AutoAi.data_compiler.run() will compile the data based on the constructor parameters. </h2>
<h5> This function takes 2 required arguments, an original data source file, and a path to the desired data directory. Given just these two arguments, this function will create a new testing data folder at dest with training, validation, and testing folders, containing folders for each class. You can alter the ratio with the ratio arguments, as well as provide a number of img transforms to do if you are using images.</h5>
<ul>
<li> Src - Path to a folder that contains a folder for each class and then data examples in those class folders. </li>
<li> Dest - Path to a folder where you want the data to end up. </li>
<li> Num_imgs_per_class - This number of images will be added to the original set for each class through transforms. The theoretical limit for this would be 3! * original images per class </li>
</ul>
<h5> Demo:</h5>
Given the a path to the following folder:
<img src="https://i.imgur.com/SSpydEv.png"></img>
If augmentation used the following results will be yielded:
<img src="https://i.imgur.com/4okyMrN.png"></img>
Then these images will be copied to the dest folder with copied file structure, but an added upper layer:
<img src="https://i.imgur.com/TY7HvL4.png"</img>
Example showing the images made it:
<img src="https://i.imgur.com/3ily5dU.png"</img>
</div>
<div class="entry">
<h2>Homeless Methods:</h2>
<h4> model_to_img(model_path) </h4>
<ul>
<li>Returns an image form of your model.</li>
</ul>
<h4> plot(history=None, file=None, min_=0, max_=1)</h4>
<ul><li>history- numpy file (Keras callback)</li>
<li>file - path to a .npy file.</li>
<li>min_ - the minimum of accuracy/loss in the graph</li>
<li>max_ - the maximum of accuracy/loss in the graph, the closer the min and max, the more zoomed your graph will be</li>
</ul>
</div>
%package -n python3-AutoAiLib
Summary: The library that automates the silly ML things.
Provides: python-AutoAiLib
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-AutoAiLib
<h1>AutoAI</h1>
<p>This repository is a compilation of scripts that I have created in my time working with machine learning. These scripts aim to automate the annoying and tedious parts of ML, allowing you to focus on what is important.
PyPi: https://pypi.org/project/AutoAILib/
</br> $ pip install autoailib </br>
This library was developed for and used with keras convolutional neural networks. They do however work with other keras models, besides image test obviously.</p>
<div class="entry">
<h1> AutoAiLib.general_tester(model path or object, labels, preprocessor)</h1>
<a href="https://youtu.be/TQisVhgUzWo"> Class Video Demo</a>
<h2> AutoAiLib.general_tester.predict_single(example)</h2>
<ul><li>example- If you have defined a preprocessor for your tester, this should comply with the preprocessor's argument. If
you have not defined a preprocessor, example must be in a form that your model will accept.</li></ul>
<h2> AutoAiLib.general_tester.predict_many(container=None, testing_folder = None, csv_dir)</h2>
<ul>
<li> container - This can be a container of test objects (any iterable). If preprocessor is defined, these objects must comply with the preprocessors parameter. Otherwise they must be in a form that your model will accept.</li>
<li> testing_dir - This can be a path to a testing folder which has sub folders of all classes. Again, must be preprocessed or have preprocessor defined.</li>
<li> csv_dir - This function compiles data into a csv folder to allow users to easily extract data from it, if not defined it will return a pandas data frame.</li>
</ul>
</div>
<div class="entry">
<h1> AutoAi.convnet_tester(model path or object, labels) </h1>
<a href="https://youtu.be/sM57JDasREk"> Class Video Demo </a>
<h2> AutoAi.image_predict(model_path, image_path, labels)</h2>
<h5> This function takes 3 arguments: a path to a keras model, a path to an image, and a list of labels.</h5>
<h5> Demo:</h5>
Given a the correct arguments, we get the following output, as well as this image saved to our model directory.
<img src="https://i.imgur.com/woiPdus.png"></img>
<h2> AutoAi.manual_test(model, testing_dir, labels) </h2>
<h5> This function tests a model given labels and testing data. It then compiles the results in a CSV file, and groups the results by class, and by correct and incorrect.</h5>
<ul>
<li> Model - Path of model that you want to test or model object.</li>
<li> Testing_dir - Path to the directory with your testing data.</li>
<li> Labels - Dictionary of the classes, in form (index:class_name)</li>
</ul>
<h5>Example csv:</h5>
<img src="https://i.imgur.com/g4gNQjS.png"></img>
</div>
<div class="entry">
<h2>Update! This has now been packaged in the AutoAI.data_compiler class.
AutoAi.data_compiler(self,src, dest, **kwargs)</br>
AutoAi.data_compiler.run() will compile the data based on the constructor parameters. </h2>
<h5> This function takes 2 required arguments, an original data source file, and a path to the desired data directory. Given just these two arguments, this function will create a new testing data folder at dest with training, validation, and testing folders, containing folders for each class. You can alter the ratio with the ratio arguments, as well as provide a number of img transforms to do if you are using images.</h5>
<ul>
<li> Src - Path to a folder that contains a folder for each class and then data examples in those class folders. </li>
<li> Dest - Path to a folder where you want the data to end up. </li>
<li> Num_imgs_per_class - This number of images will be added to the original set for each class through transforms. The theoretical limit for this would be 3! * original images per class </li>
</ul>
<h5> Demo:</h5>
Given the a path to the following folder:
<img src="https://i.imgur.com/SSpydEv.png"></img>
If augmentation used the following results will be yielded:
<img src="https://i.imgur.com/4okyMrN.png"></img>
Then these images will be copied to the dest folder with copied file structure, but an added upper layer:
<img src="https://i.imgur.com/TY7HvL4.png"</img>
Example showing the images made it:
<img src="https://i.imgur.com/3ily5dU.png"</img>
</div>
<div class="entry">
<h2>Homeless Methods:</h2>
<h4> model_to_img(model_path) </h4>
<ul>
<li>Returns an image form of your model.</li>
</ul>
<h4> plot(history=None, file=None, min_=0, max_=1)</h4>
<ul><li>history- numpy file (Keras callback)</li>
<li>file - path to a .npy file.</li>
<li>min_ - the minimum of accuracy/loss in the graph</li>
<li>max_ - the maximum of accuracy/loss in the graph, the closer the min and max, the more zoomed your graph will be</li>
</ul>
</div>
%package help
Summary: Development documents and examples for AutoAiLib
Provides: python3-AutoAiLib-doc
%description help
<h1>AutoAI</h1>
<p>This repository is a compilation of scripts that I have created in my time working with machine learning. These scripts aim to automate the annoying and tedious parts of ML, allowing you to focus on what is important.
PyPi: https://pypi.org/project/AutoAILib/
</br> $ pip install autoailib </br>
This library was developed for and used with keras convolutional neural networks. They do however work with other keras models, besides image test obviously.</p>
<div class="entry">
<h1> AutoAiLib.general_tester(model path or object, labels, preprocessor)</h1>
<a href="https://youtu.be/TQisVhgUzWo"> Class Video Demo</a>
<h2> AutoAiLib.general_tester.predict_single(example)</h2>
<ul><li>example- If you have defined a preprocessor for your tester, this should comply with the preprocessor's argument. If
you have not defined a preprocessor, example must be in a form that your model will accept.</li></ul>
<h2> AutoAiLib.general_tester.predict_many(container=None, testing_folder = None, csv_dir)</h2>
<ul>
<li> container - This can be a container of test objects (any iterable). If preprocessor is defined, these objects must comply with the preprocessors parameter. Otherwise they must be in a form that your model will accept.</li>
<li> testing_dir - This can be a path to a testing folder which has sub folders of all classes. Again, must be preprocessed or have preprocessor defined.</li>
<li> csv_dir - This function compiles data into a csv folder to allow users to easily extract data from it, if not defined it will return a pandas data frame.</li>
</ul>
</div>
<div class="entry">
<h1> AutoAi.convnet_tester(model path or object, labels) </h1>
<a href="https://youtu.be/sM57JDasREk"> Class Video Demo </a>
<h2> AutoAi.image_predict(model_path, image_path, labels)</h2>
<h5> This function takes 3 arguments: a path to a keras model, a path to an image, and a list of labels.</h5>
<h5> Demo:</h5>
Given a the correct arguments, we get the following output, as well as this image saved to our model directory.
<img src="https://i.imgur.com/woiPdus.png"></img>
<h2> AutoAi.manual_test(model, testing_dir, labels) </h2>
<h5> This function tests a model given labels and testing data. It then compiles the results in a CSV file, and groups the results by class, and by correct and incorrect.</h5>
<ul>
<li> Model - Path of model that you want to test or model object.</li>
<li> Testing_dir - Path to the directory with your testing data.</li>
<li> Labels - Dictionary of the classes, in form (index:class_name)</li>
</ul>
<h5>Example csv:</h5>
<img src="https://i.imgur.com/g4gNQjS.png"></img>
</div>
<div class="entry">
<h2>Update! This has now been packaged in the AutoAI.data_compiler class.
AutoAi.data_compiler(self,src, dest, **kwargs)</br>
AutoAi.data_compiler.run() will compile the data based on the constructor parameters. </h2>
<h5> This function takes 2 required arguments, an original data source file, and a path to the desired data directory. Given just these two arguments, this function will create a new testing data folder at dest with training, validation, and testing folders, containing folders for each class. You can alter the ratio with the ratio arguments, as well as provide a number of img transforms to do if you are using images.</h5>
<ul>
<li> Src - Path to a folder that contains a folder for each class and then data examples in those class folders. </li>
<li> Dest - Path to a folder where you want the data to end up. </li>
<li> Num_imgs_per_class - This number of images will be added to the original set for each class through transforms. The theoretical limit for this would be 3! * original images per class </li>
</ul>
<h5> Demo:</h5>
Given the a path to the following folder:
<img src="https://i.imgur.com/SSpydEv.png"></img>
If augmentation used the following results will be yielded:
<img src="https://i.imgur.com/4okyMrN.png"></img>
Then these images will be copied to the dest folder with copied file structure, but an added upper layer:
<img src="https://i.imgur.com/TY7HvL4.png"</img>
Example showing the images made it:
<img src="https://i.imgur.com/3ily5dU.png"</img>
</div>
<div class="entry">
<h2>Homeless Methods:</h2>
<h4> model_to_img(model_path) </h4>
<ul>
<li>Returns an image form of your model.</li>
</ul>
<h4> plot(history=None, file=None, min_=0, max_=1)</h4>
<ul><li>history- numpy file (Keras callback)</li>
<li>file - path to a .npy file.</li>
<li>min_ - the minimum of accuracy/loss in the graph</li>
<li>max_ - the maximum of accuracy/loss in the graph, the closer the min and max, the more zoomed your graph will be</li>
</ul>
</div>
%prep
%autosetup -n AutoAiLib-1.1.0
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-AutoAiLib -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Thu Jun 08 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.0-1
- Package Spec generated
|