Compare commits
56 Commits
4311262fb6
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 66fe32e4b0 | |||
| 0e6cfbec38 | |||
| 74934ee17f | |||
| 985aebf2ca | |||
| 223384ef23 | |||
| 62b34bd487 | |||
| 639058da94 | |||
| 63177fcdaa | |||
| b4ae8b3a7f | |||
| 12ef43f1a1 | |||
| 63d630c518 | |||
| 04b13f0e2e | |||
| 6248e41745 | |||
| cc5e6b6a52 | |||
| 3445d03d15 | |||
| 3489cce48f | |||
| 73b43e300c | |||
| f17bba3b02 | |||
| b51aa11253 | |||
| 3fee37e4fe | |||
| 8df15529d1 | |||
| e790994142 | |||
| dc60c8ac5f | |||
| 3eac9a5f03 | |||
| fec716a305 | |||
| 255440e0cc | |||
| 905646cc7f | |||
| 2998821586 | |||
| 7df410930a | |||
| 9313ac6dc2 | |||
| ada61d977d | |||
| 436a8c0dce | |||
| 743880926f | |||
| 3b0e283a9c | |||
| 2079e9d5cb | |||
| 05cefc1ac2 | |||
| e23c9a3003 | |||
| 1e657bb5a8 | |||
| 95a6d484d0 | |||
| ff2ec9ff9e | |||
| 90f8344ab3 | |||
| 259f23e7dc | |||
| d91534b584 | |||
| 9392ef05aa | |||
| fdcfc7ba78 | |||
| e6141cfe7c | |||
| 0eb7b9c458 | |||
| 833bf870b3 | |||
| fcff531caf | |||
| 6692e85d73 | |||
| 973f87071b | |||
| a970a9a53e | |||
| e71b1e6752 | |||
| d43dd3831b | |||
| 75f1ae5148 | |||
| 471823a4ef |
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
# Use an official Python runtime as a parent image
|
||||
FROM python:3.8.10
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /opt/attendance
|
||||
|
||||
# Copy the current directory contents into the container at /opt/attendance
|
||||
COPY . .
|
||||
|
||||
# Install any needed packages specified in requirements.txt
|
||||
RUN apt update && apt install -y libgl1-mesa-glx && apt --fix-broken install && \
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Make port 5003 available to the world outside this container
|
||||
EXPOSE 5003
|
||||
|
||||
# Run app.py when the container launches
|
||||
CMD ["python", "./attendence.py"]
|
||||
+27
-26
@@ -36,9 +36,11 @@ def createEncodings(image):
|
||||
# Create encodings for all faces in an image
|
||||
known_encodings = face_recognition.face_encodings(image, known_face_locations=face_locations)
|
||||
return known_encodings, face_locations
|
||||
#@app.route('/registered', methods=["POST","GET"])
|
||||
def registered(url_list):
|
||||
input=url_list
|
||||
@app.route('/register', methods=["POST","GET"])
|
||||
def registered():
|
||||
input= request.get_json()
|
||||
#input=url_list
|
||||
#print(input)
|
||||
|
||||
from pathlib import Path
|
||||
Path(People).mkdir(exist_ok=True)
|
||||
@@ -225,8 +227,9 @@ def registered(url_list):
|
||||
|
||||
|
||||
# ******************************** COMPARUISION *********************************************************
|
||||
#@app.route('/submit', methods=["POST","GET"])
|
||||
def submit(url_list):
|
||||
@app.route('/detect', methods=["POST","GET"])
|
||||
def submit():
|
||||
input= request.get_json()
|
||||
|
||||
from datetime import datetime
|
||||
import pytz
|
||||
@@ -236,7 +239,7 @@ def submit(url_list):
|
||||
India_Date = str(India_Date)
|
||||
# India_Time = (datetime_NY.strftime("%I:%M:%S %p"))
|
||||
# India_Time = str(India_Time)
|
||||
input=url_list
|
||||
#input=url_list
|
||||
import pickle
|
||||
import cv2
|
||||
|
||||
@@ -278,9 +281,7 @@ def submit(url_list):
|
||||
else:
|
||||
print ("pickle File not exist")
|
||||
print(name)
|
||||
return "Please get registered with your Profile Picture",500
|
||||
# return "Face not found in profile (please change your profile)",500
|
||||
|
||||
return "Face not found in profile (please change your profile)"
|
||||
|
||||
check_faces=People+"/" + y + "/" + y + ".jpg"
|
||||
print(check_faces)
|
||||
@@ -334,7 +335,7 @@ def submit(url_list):
|
||||
|
||||
if (len(number_of_faces))>1:
|
||||
print("Group Photo")
|
||||
return "Too Many Faces in Profile Picture",500
|
||||
return "Group Photo"
|
||||
elif (len(number_of_faces))==1:
|
||||
print("Single Photo")
|
||||
pass
|
||||
@@ -508,11 +509,10 @@ def detect():
|
||||
try:
|
||||
results = pool.map(submit, url_list)
|
||||
except FileNotFoundError:
|
||||
return 'please get registered with your PhotoID',500
|
||||
return 'plese get registered with your PhotoID'
|
||||
except IndexError:
|
||||
#return 'unable to recognize face'
|
||||
#return 'failed',500
|
||||
return "Face does not Match with Profile Picture",500
|
||||
return 'failed'
|
||||
|
||||
pool.close()
|
||||
|
||||
@@ -520,7 +520,7 @@ def detect():
|
||||
|
||||
|
||||
|
||||
@app.route('/register', methods=["POST"])
|
||||
#@app.route('/register', methods=["POST"])
|
||||
def register():
|
||||
print("hello start..........")
|
||||
if __name__ == "__main__":
|
||||
@@ -539,22 +539,23 @@ def register():
|
||||
|
||||
|
||||
# multiprocessing
|
||||
pool_size = multiprocessing.cpu_count() * 2
|
||||
with multiprocessing.Pool(pool_size) as pool:
|
||||
try:
|
||||
results = pool.map(registered, url_list)
|
||||
except IndexError:
|
||||
pass
|
||||
print('face not found')
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
# pool_size = multiprocessing.cpu_count() * 2
|
||||
# with multiprocessing.Pool(pool_size) as pool:
|
||||
# try:
|
||||
# results = pool.map(registered, url_list)
|
||||
# except IndexError:
|
||||
# pass
|
||||
# print('face not found')
|
||||
# except FileNotFoundError:
|
||||
# pass
|
||||
|
||||
|
||||
#os.remove(img)
|
||||
# return 'unable to recognize face'
|
||||
# #os.remove(img)
|
||||
# # return 'unable to recognize face'
|
||||
|
||||
pool.close()
|
||||
# pool.close()
|
||||
#return results[0]
|
||||
result=registered(url_list)
|
||||
return 'Successfully saved encoding.........'
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
+15
-400
@@ -1,402 +1,17 @@
|
||||
absl-py==1.3.0
|
||||
aio-pika==8.2.3
|
||||
aiofiles==23.1.0
|
||||
aiogram==2.25.1
|
||||
aiohttp @ file:///tmp/build/80754af9/aiohttp_1646806365504/work
|
||||
aiormq==6.4.2
|
||||
aiosignal @ file:///tmp/build/80754af9/aiosignal_1637843061372/work
|
||||
alabaster @ file:///home/ktietz/src/ci/alabaster_1611921544520/work
|
||||
anaconda-client @ file:///tmp/build/80754af9/anaconda-client_1635342557008/work
|
||||
anaconda-navigator==2.1.4
|
||||
anaconda-project @ file:///tmp/build/80754af9/anaconda-project_1637161053845/work
|
||||
anyio @ file:///tmp/build/80754af9/anyio_1644463572971/work/dist
|
||||
appdirs==1.4.4
|
||||
APScheduler==3.9.1.post1
|
||||
argon2-cffi @ file:///opt/conda/conda-bld/argon2-cffi_1645000214183/work
|
||||
argon2-cffi-bindings @ file:///tmp/build/80754af9/argon2-cffi-bindings_1644569679365/work
|
||||
arrow @ file:///opt/conda/conda-bld/arrow_1649166651673/work
|
||||
astroid @ file:///tmp/build/80754af9/astroid_1628063140030/work
|
||||
astropy @ file:///opt/conda/conda-bld/astropy_1650891077797/work
|
||||
asttokens @ file:///opt/conda/conda-bld/asttokens_1646925590279/work
|
||||
astunparse==1.6.3
|
||||
async-timeout==4.0.2
|
||||
atomicwrites==1.4.0
|
||||
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
|
||||
Automat @ file:///tmp/build/80754af9/automat_1600298431173/work
|
||||
autopep8 @ file:///opt/conda/conda-bld/autopep8_1639166893812/work
|
||||
Babel @ file:///tmp/build/80754af9/babel_1620871417480/work
|
||||
backcall @ file:///home/ktietz/src/ci/backcall_1611930011877/work
|
||||
backports.functools-lru-cache @ file:///tmp/build/80754af9/backports.functools_lru_cache_1618170165463/work
|
||||
backports.tempfile @ file:///home/linux1/recipes/ci/backports.tempfile_1610991236607/work
|
||||
backports.weakref==1.0.post1
|
||||
bcrypt @ file:///tmp/build/80754af9/bcrypt_1607022650461/work
|
||||
beautifulsoup4 @ file:///opt/conda/conda-bld/beautifulsoup4_1650462163268/work
|
||||
bidict==0.22.1
|
||||
binaryornot @ file:///tmp/build/80754af9/binaryornot_1617751525010/work
|
||||
bitarray @ file:///tmp/build/80754af9/bitarray_1648739490228/work
|
||||
bkcharts==0.2
|
||||
black==19.10b0
|
||||
bleach @ file:///opt/conda/conda-bld/bleach_1641577558959/work
|
||||
bokeh @ file:///tmp/build/80754af9/bokeh_1638362822154/work
|
||||
boto3 @ file:///opt/conda/conda-bld/boto3_1649078879353/work
|
||||
botocore @ file:///opt/conda/conda-bld/botocore_1649076662316/work
|
||||
Bottleneck @ file:///tmp/build/80754af9/bottleneck_1648028898966/work
|
||||
brotlipy==0.7.0
|
||||
CacheControl==0.12.11
|
||||
cachetools @ file:///tmp/build/80754af9/cachetools_1619597386817/work
|
||||
certifi==2021.10.8
|
||||
cffi @ file:///opt/conda/conda-bld/cffi_1642701102775/work
|
||||
chardet @ file:///tmp/build/80754af9/chardet_1607706775000/work
|
||||
charset-normalizer @ file:///tmp/build/80754af9/charset-normalizer_1630003229654/work
|
||||
click @ file:///tmp/build/80754af9/click_1646056590078/work
|
||||
cloudpickle @ file:///tmp/build/80754af9/cloudpickle_1632508026186/work
|
||||
clyent==1.2.2
|
||||
colorama @ file:///tmp/build/80754af9/colorama_1607707115595/work
|
||||
colorcet @ file:///tmp/build/80754af9/colorcet_1611168489822/work
|
||||
colorclass==2.2.2
|
||||
coloredlogs==15.0.1
|
||||
colorhash==1.2.1
|
||||
conda==4.12.0
|
||||
conda-build==3.21.8
|
||||
conda-content-trust @ file:///tmp/build/80754af9/conda-content-trust_1617045594566/work
|
||||
conda-pack @ file:///tmp/build/80754af9/conda-pack_1611163042455/work
|
||||
conda-package-handling @ file:///tmp/build/80754af9/conda-package-handling_1649105784853/work
|
||||
conda-repo-cli @ file:///tmp/build/80754af9/conda-repo-cli_1620168426516/work
|
||||
conda-token @ file:///tmp/build/80754af9/conda-token_1620076980546/work
|
||||
conda-verify==3.4.2
|
||||
confluent-kafka==1.9.2
|
||||
constantly==15.1.0
|
||||
cookiecutter @ file:///opt/conda/conda-bld/cookiecutter_1649151442564/work
|
||||
cryptography @ file:///tmp/build/80754af9/cryptography_1633520369886/work
|
||||
cssselect==1.1.0
|
||||
cycler @ file:///tmp/build/80754af9/cycler_1637851556182/work
|
||||
Cython @ file:///tmp/build/80754af9/cython_1647850345254/work
|
||||
cytoolz==0.11.0
|
||||
daal4py==2021.5.0
|
||||
dask==2022.10.2
|
||||
datashader @ file:///tmp/build/80754af9/datashader_1623782308369/work
|
||||
datashape==0.5.4
|
||||
debugpy @ file:///tmp/build/80754af9/debugpy_1637091799509/work
|
||||
decorator @ file:///opt/conda/conda-bld/decorator_1643638310831/work
|
||||
defusedxml @ file:///tmp/build/80754af9/defusedxml_1615228127516/work
|
||||
diff-match-patch @ file:///Users/ktietz/demo/mc3/conda-bld/diff-match-patch_1630511840874/work
|
||||
distributed @ file:///opt/conda/conda-bld/distributed_1647271944416/work
|
||||
dlib==19.24.0
|
||||
dnspython==1.16.0
|
||||
docopt==0.6.2
|
||||
docutils @ file:///tmp/build/80754af9/docutils_1620827980776/work
|
||||
entrypoints @ file:///tmp/build/80754af9/entrypoints_1649926439650/work
|
||||
et-xmlfile==1.1.0
|
||||
executing @ file:///opt/conda/conda-bld/executing_1646925071911/work
|
||||
blinker==1.7.0
|
||||
click==8.1.7
|
||||
colorama==0.4.6
|
||||
dlib==19.24.2
|
||||
face-recognition==1.3.0
|
||||
face-recognition-models==0.3.0
|
||||
fastjsonschema @ file:///tmp/build/80754af9/python-fastjsonschema_1620414857593/work/dist
|
||||
fbmessenger==6.0.0
|
||||
filelock @ file:///opt/conda/conda-bld/filelock_1647002191454/work
|
||||
fire==0.5.0
|
||||
flake8 @ file:///tmp/build/80754af9/flake8_1620776156532/work
|
||||
Flask @ file:///home/ktietz/src/ci/flask_1611932660458/work
|
||||
flatbuffers==23.3.3
|
||||
fonttools==4.25.0
|
||||
frozenlist @ file:///tmp/build/80754af9/frozenlist_1637767113340/work
|
||||
fsspec @ file:///opt/conda/conda-bld/fsspec_1647268051896/work
|
||||
future @ file:///tmp/build/80754af9/future_1607571303524/work
|
||||
gast==0.4.0
|
||||
gensim @ file:///tmp/build/80754af9/gensim_1646806807927/work
|
||||
glob2 @ file:///home/linux1/recipes/ci/glob2_1610991677669/work
|
||||
gmpy2 @ file:///tmp/build/80754af9/gmpy2_1645438755360/work
|
||||
google-api-core @ file:///C:/ci/google-api-core-split_1613980333946/work
|
||||
google-auth @ file:///tmp/build/80754af9/google-auth_1626320605116/work
|
||||
google-auth-oauthlib==0.4.6
|
||||
google-cloud-core @ file:///tmp/build/80754af9/google-cloud-core_1625077425256/work
|
||||
google-cloud-storage @ file:///tmp/build/80754af9/google-cloud-storage_1601307969662/work
|
||||
google-crc32c @ file:///tmp/build/80754af9/google-crc32c_1612242928148/work
|
||||
google-pasta==0.2.0
|
||||
google-resumable-media @ file:///tmp/build/80754af9/google-resumable-media_1624367812531/work
|
||||
googleapis-common-protos @ file:///tmp/build/80754af9/googleapis-common-protos-feedstock_1617957652138/work
|
||||
greenlet @ file:///tmp/build/80754af9/greenlet_1628888132713/work
|
||||
grpcio @ file:///tmp/build/80754af9/grpcio_1637590821884/work
|
||||
h5py @ file:///tmp/build/80754af9/h5py_1637138488546/work
|
||||
HeapDict @ file:///Users/ktietz/demo/mc3/conda-bld/heapdict_1630598515714/work
|
||||
holoviews @ file:///opt/conda/conda-bld/holoviews_1645454331194/work
|
||||
httptools==0.5.0
|
||||
humanfriendly==10.0
|
||||
hvplot @ file:///tmp/build/80754af9/hvplot_1627305124151/work
|
||||
hyperlink @ file:///tmp/build/80754af9/hyperlink_1610130746837/work
|
||||
idna @ file:///tmp/build/80754af9/idna_1637925883363/work
|
||||
imagecodecs @ file:///tmp/build/80754af9/imagecodecs_1635529108216/work
|
||||
imageio @ file:///tmp/build/80754af9/imageio_1617700267927/work
|
||||
imagesize @ file:///tmp/build/80754af9/imagesize_1637939814114/work
|
||||
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1648544546694/work
|
||||
incremental @ file:///tmp/build/80754af9/incremental_1636629750599/work
|
||||
inflection==0.5.1
|
||||
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
|
||||
intake @ file:///opt/conda/conda-bld/intake_1647436631684/work
|
||||
intervaltree @ file:///Users/ktietz/demo/mc3/conda-bld/intervaltree_1630511889664/work
|
||||
ipykernel @ file:///tmp/build/80754af9/ipykernel_1647000773790/work/dist/ipykernel-6.9.1-py3-none-any.whl
|
||||
ipython @ file:///tmp/build/80754af9/ipython_1648817057602/work
|
||||
ipython-genutils @ file:///tmp/build/80754af9/ipython_genutils_1606773439826/work
|
||||
ipywidgets @ file:///tmp/build/80754af9/ipywidgets_1634143127070/work
|
||||
isort @ file:///tmp/build/80754af9/isort_1628603791788/work
|
||||
itemadapter @ file:///tmp/build/80754af9/itemadapter_1626442940632/work
|
||||
itemloaders @ file:///opt/conda/conda-bld/itemloaders_1646805235997/work
|
||||
itsdangerous @ file:///tmp/build/80754af9/itsdangerous_1621432558163/work
|
||||
jdcal @ file:///Users/ktietz/demo/mc3/conda-bld/jdcal_1630584345063/work
|
||||
jedi @ file:///tmp/build/80754af9/jedi_1644297102865/work
|
||||
jeepney @ file:///tmp/build/80754af9/jeepney_1627537048313/work
|
||||
Jinja2 @ file:///tmp/build/80754af9/jinja2_1612213139570/work
|
||||
jinja2-time @ file:///opt/conda/conda-bld/jinja2-time_1649251842261/work
|
||||
jmespath @ file:///Users/ktietz/demo/mc3/conda-bld/jmespath_1630583964805/work
|
||||
joblib @ file:///tmp/build/80754af9/joblib_1635411271373/work
|
||||
json5 @ file:///tmp/build/80754af9/json5_1624432770122/work
|
||||
jsonpickle==3.0.1
|
||||
jsonschema @ file:///tmp/build/80754af9/jsonschema_1650025953207/work
|
||||
jupyter @ file:///tmp/build/80754af9/jupyter_1607700846274/work
|
||||
jupyter-client @ file:///tmp/build/80754af9/jupyter_client_1616770841739/work
|
||||
jupyter-console @ file:///tmp/build/80754af9/jupyter_console_1616615302928/work
|
||||
jupyter-core @ file:///tmp/build/80754af9/jupyter_core_1646976314572/work
|
||||
jupyter-server @ file:///opt/conda/conda-bld/jupyter_server_1644494914632/work
|
||||
jupyterlab @ file:///opt/conda/conda-bld/jupyterlab_1647445413472/work
|
||||
jupyterlab-pygments @ file:///tmp/build/80754af9/jupyterlab_pygments_1601490720602/work
|
||||
jupyterlab-server @ file:///opt/conda/conda-bld/jupyterlab_server_1644500396812/work
|
||||
jupyterlab-widgets @ file:///tmp/build/80754af9/jupyterlab_widgets_1609884341231/work
|
||||
keras==2.11.0
|
||||
keyring @ file:///tmp/build/80754af9/keyring_1638531355686/work
|
||||
kiwisolver @ file:///opt/conda/conda-bld/kiwisolver_1638569886207/work
|
||||
lazy-object-proxy @ file:///tmp/build/80754af9/lazy-object-proxy_1616529027849/work
|
||||
libarchive-c @ file:///tmp/build/80754af9/python-libarchive-c_1617780486945/work
|
||||
libclang==16.0.0
|
||||
llvmlite==0.38.0
|
||||
locket @ file:///tmp/build/80754af9/locket_1647006009810/work
|
||||
lxml @ file:///tmp/build/80754af9/lxml_1646624513062/work
|
||||
magic-filter==1.0.9
|
||||
Markdown @ file:///tmp/build/80754af9/markdown_1614363852612/work
|
||||
MarkupSafe @ file:///tmp/build/80754af9/markupsafe_1621523467000/work
|
||||
matplotlib @ file:///tmp/build/80754af9/matplotlib-suite_1647441664166/work
|
||||
matplotlib-inline @ file:///tmp/build/80754af9/matplotlib-inline_1628242447089/work
|
||||
mattermostwrapper==2.2
|
||||
mccabe==0.6.1
|
||||
mistune @ file:///tmp/build/80754af9/mistune_1607364877025/work
|
||||
mkl-fft==1.3.1
|
||||
mkl-random @ file:///tmp/build/80754af9/mkl_random_1626186066731/work
|
||||
mkl-service==2.4.0
|
||||
mock @ file:///tmp/build/80754af9/mock_1607622725907/work
|
||||
mpmath==1.2.1
|
||||
msgpack @ file:///tmp/build/80754af9/msgpack-python_1612287166301/work
|
||||
multidict @ file:///opt/conda/conda-bld/multidict_1640703752579/work
|
||||
multipledispatch @ file:///tmp/build/80754af9/multipledispatch_1607574243360/work
|
||||
munkres==1.1.4
|
||||
mypy-extensions==0.4.3
|
||||
navigator-updater==0.2.1
|
||||
nbclassic @ file:///opt/conda/conda-bld/nbclassic_1644943264176/work
|
||||
nbclient @ file:///tmp/build/80754af9/nbclient_1650290509967/work
|
||||
nbconvert @ file:///opt/conda/conda-bld/nbconvert_1649751911790/work
|
||||
nbformat @ file:///tmp/build/80754af9/nbformat_1649826788557/work
|
||||
nest-asyncio @ file:///tmp/build/80754af9/nest-asyncio_1649847906199/work
|
||||
networkx==2.6.3
|
||||
nltk @ file:///opt/conda/conda-bld/nltk_1645628263994/work
|
||||
nose @ file:///opt/conda/conda-bld/nose_1642704612149/work
|
||||
notebook @ file:///tmp/build/80754af9/notebook_1645002532094/work
|
||||
numba @ file:///opt/conda/conda-bld/numba_1648040517072/work
|
||||
numexpr @ file:///tmp/build/80754af9/numexpr_1640689833592/work
|
||||
numpy @ file:///tmp/build/80754af9/numpy_and_numpy_base_1649764630438/work
|
||||
numpydoc @ file:///opt/conda/conda-bld/numpydoc_1643788541039/work
|
||||
oauthlib==3.2.2
|
||||
olefile @ file:///Users/ktietz/demo/mc3/conda-bld/olefile_1629805411829/work
|
||||
opencv-python==4.7.0.72
|
||||
openpyxl @ file:///tmp/build/80754af9/openpyxl_1632777717936/work
|
||||
opt-einsum==3.3.0
|
||||
packaging==20.9
|
||||
pamqp==3.2.1
|
||||
pandas==1.4.2
|
||||
pandocfilters @ file:///opt/conda/conda-bld/pandocfilters_1643405455980/work
|
||||
panel @ file:///opt/conda/conda-bld/panel_1650637168846/work
|
||||
param @ file:///tmp/build/80754af9/param_1636647414893/work
|
||||
parsel @ file:///tmp/build/80754af9/parsel_1646722533460/work
|
||||
parso @ file:///opt/conda/conda-bld/parso_1641458642106/work
|
||||
partd @ file:///opt/conda/conda-bld/partd_1647245470509/work
|
||||
pathspec==0.7.0
|
||||
patsy==0.5.2
|
||||
pep8==1.7.1
|
||||
pexpect @ file:///tmp/build/80754af9/pexpect_1605563209008/work
|
||||
pickleshare @ file:///tmp/build/80754af9/pickleshare_1606932040724/work
|
||||
Pillow==9.0.1
|
||||
pkginfo @ file:///tmp/build/80754af9/pkginfo_1643162084911/work
|
||||
plotly @ file:///opt/conda/conda-bld/plotly_1646671701182/work
|
||||
pluggy @ file:///tmp/build/80754af9/pluggy_1648024445381/work
|
||||
poyo @ file:///tmp/build/80754af9/poyo_1617751526755/work
|
||||
prometheus-client @ file:///opt/conda/conda-bld/prometheus_client_1643788673601/work
|
||||
prompt-toolkit @ file:///tmp/build/80754af9/prompt-toolkit_1633440160888/work
|
||||
Protego @ file:///tmp/build/80754af9/protego_1598657180827/work
|
||||
protobuf==3.19.1
|
||||
psutil @ file:///tmp/build/80754af9/psutil_1612297992929/work
|
||||
psycopg2-binary==2.9.6
|
||||
ptyprocess @ file:///tmp/build/80754af9/ptyprocess_1609355006118/work/dist/ptyprocess-0.7.0-py2.py3-none-any.whl
|
||||
pure-eval @ file:///opt/conda/conda-bld/pure_eval_1646925070566/work
|
||||
py @ file:///opt/conda/conda-bld/py_1644396412707/work
|
||||
pyasn1 @ file:///Users/ktietz/demo/mc3/conda-bld/pyasn1_1629708007385/work
|
||||
pyasn1-modules==0.2.8
|
||||
pycodestyle @ file:///tmp/build/80754af9/pycodestyle_1615748559966/work
|
||||
pycosat==0.6.3
|
||||
pycparser @ file:///tmp/build/80754af9/pycparser_1636541352034/work
|
||||
pyct @ file:///tmp/build/80754af9/pyct_1613411549454/work
|
||||
pycurl==7.44.1
|
||||
pydantic==1.10.2
|
||||
PyDispatcher==2.0.5
|
||||
pydocstyle @ file:///tmp/build/80754af9/pydocstyle_1621600989141/work
|
||||
pydot==1.4.2
|
||||
pyerfa @ file:///tmp/build/80754af9/pyerfa_1621556109336/work
|
||||
pyflakes @ file:///tmp/build/80754af9/pyflakes_1617200973297/work
|
||||
Pygments @ file:///opt/conda/conda-bld/pygments_1644249106324/work
|
||||
PyHamcrest @ file:///tmp/build/80754af9/pyhamcrest_1615748656804/work
|
||||
PyJWT @ file:///tmp/build/80754af9/pyjwt_1619682484438/work
|
||||
pykwalify==1.8.0
|
||||
pylint @ file:///tmp/build/80754af9/pylint_1627536788603/work
|
||||
pyls-spyder==0.4.0
|
||||
pymongo==3.10.1
|
||||
pyodbc @ file:///tmp/build/80754af9/pyodbc_1647425888968/work
|
||||
pyOpenSSL @ file:///tmp/build/80754af9/pyopenssl_1635333100036/work
|
||||
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
|
||||
pyrsistent @ file:///tmp/build/80754af9/pyrsistent_1636110951836/work
|
||||
PySocks @ file:///tmp/build/80754af9/pysocks_1605305812635/work
|
||||
pytest==7.1.1
|
||||
python-crfsuite==0.9.9
|
||||
python-dateutil @ file:///tmp/build/80754af9/python-dateutil_1626374649649/work
|
||||
python-engineio==4.4.0
|
||||
python-lsp-black @ file:///tmp/build/80754af9/python-lsp-black_1634232156041/work
|
||||
python-lsp-jsonrpc==1.0.0
|
||||
python-lsp-server==1.2.4
|
||||
python-slugify @ file:///tmp/build/80754af9/python-slugify_1620405669636/work
|
||||
python-snappy @ file:///tmp/build/80754af9/python-snappy_1610133040135/work
|
||||
python-socketio==5.8.0
|
||||
pytz==2021.3
|
||||
pytz-deprecation-shim==0.1.0.post0
|
||||
pyviz-comms @ file:///tmp/build/80754af9/pyviz_comms_1623747165329/work
|
||||
PyWavelets @ file:///tmp/build/80754af9/pywavelets_1648710015787/work
|
||||
pyxdg @ file:///tmp/build/80754af9/pyxdg_1603822279816/work
|
||||
PyYAML==6.0
|
||||
pyzmq @ file:///tmp/build/80754af9/pyzmq_1638434985866/work
|
||||
QDarkStyle @ file:///tmp/build/80754af9/qdarkstyle_1617386714626/work
|
||||
qstylizer @ file:///tmp/build/80754af9/qstylizer_1617713584600/work/dist/qstylizer-0.1.10-py2.py3-none-any.whl
|
||||
QtAwesome @ file:///tmp/build/80754af9/qtawesome_1637160816833/work
|
||||
qtconsole @ file:///opt/conda/conda-bld/qtconsole_1649078897110/work
|
||||
QtPy @ file:///opt/conda/conda-bld/qtpy_1649073884068/work
|
||||
questionary==1.10.0
|
||||
queuelib==1.5.0
|
||||
randomname==0.1.5
|
||||
rasa==3.5.4
|
||||
rasa-sdk==3.5.0
|
||||
redis==4.5.4
|
||||
regex @ file:///tmp/build/80754af9/regex_1648447707500/work
|
||||
requests @ file:///opt/conda/conda-bld/requests_1641824580448/work
|
||||
requests-file @ file:///Users/ktietz/demo/mc3/conda-bld/requests-file_1629455781986/work
|
||||
requests-oauthlib==1.3.1
|
||||
requests-toolbelt==0.10.1
|
||||
rocketchat-API==1.28.1
|
||||
rope @ file:///opt/conda/conda-bld/rope_1643788605236/work
|
||||
rsa @ file:///tmp/build/80754af9/rsa_1614366226499/work
|
||||
Rtree @ file:///tmp/build/80754af9/rtree_1618420843093/work
|
||||
ruamel-yaml-conda @ file:///tmp/build/80754af9/ruamel_yaml_1616016711199/work
|
||||
ruamel.yaml==0.17.21
|
||||
ruamel.yaml.clib==0.2.7
|
||||
s3transfer @ file:///tmp/build/80754af9/s3transfer_1626435152308/work
|
||||
sanic==21.12.2
|
||||
Sanic-Cors==2.0.1
|
||||
sanic-jwt==1.8.0
|
||||
sanic-routing==0.7.2
|
||||
scikit-image @ file:///tmp/build/80754af9/scikit-image_1648214171611/work
|
||||
scikit-learn @ file:///tmp/build/80754af9/scikit-learn_1642617106979/work
|
||||
scikit-learn-intelex==2021.20220215.212715
|
||||
scipy @ file:///tmp/build/80754af9/scipy_1641555004408/work
|
||||
Scrapy @ file:///tmp/build/80754af9/scrapy_1646837771788/work
|
||||
seaborn @ file:///tmp/build/80754af9/seaborn_1629307859561/work
|
||||
SecretStorage @ file:///tmp/build/80754af9/secretstorage_1614022780358/work
|
||||
Send2Trash @ file:///tmp/build/80754af9/send2trash_1632406701022/work
|
||||
sentry-sdk==1.14.0
|
||||
service-identity @ file:///Users/ktietz/demo/mc3/conda-bld/service_identity_1629460757137/work
|
||||
sip==4.19.13
|
||||
six @ file:///tmp/build/80754af9/six_1644875935023/work
|
||||
sklearn-crfsuite==0.3.6
|
||||
slack-sdk==3.21.0
|
||||
smart-open @ file:///tmp/build/80754af9/smart_open_1623928409369/work
|
||||
sniffio @ file:///tmp/build/80754af9/sniffio_1614030464178/work
|
||||
snowballstemmer @ file:///tmp/build/80754af9/snowballstemmer_1637937080595/work
|
||||
sortedcollections @ file:///tmp/build/80754af9/sortedcollections_1611172717284/work
|
||||
sortedcontainers @ file:///tmp/build/80754af9/sortedcontainers_1623949099177/work
|
||||
soupsieve @ file:///tmp/build/80754af9/soupsieve_1636706018808/work
|
||||
Sphinx @ file:///opt/conda/conda-bld/sphinx_1643644169832/work
|
||||
sphinxcontrib-applehelp @ file:///home/ktietz/src/ci/sphinxcontrib-applehelp_1611920841464/work
|
||||
sphinxcontrib-devhelp @ file:///home/ktietz/src/ci/sphinxcontrib-devhelp_1611920923094/work
|
||||
sphinxcontrib-htmlhelp @ file:///tmp/build/80754af9/sphinxcontrib-htmlhelp_1623945626792/work
|
||||
sphinxcontrib-jsmath @ file:///home/ktietz/src/ci/sphinxcontrib-jsmath_1611920942228/work
|
||||
sphinxcontrib-qthelp @ file:///home/ktietz/src/ci/sphinxcontrib-qthelp_1611921055322/work
|
||||
sphinxcontrib-serializinghtml @ file:///tmp/build/80754af9/sphinxcontrib-serializinghtml_1624451540180/work
|
||||
spyder @ file:///tmp/build/80754af9/spyder_1636479868270/work
|
||||
spyder-kernels @ file:///tmp/build/80754af9/spyder-kernels_1634236920897/work
|
||||
SQLAlchemy @ file:///tmp/build/80754af9/sqlalchemy_1647581680159/work
|
||||
stack-data @ file:///opt/conda/conda-bld/stack_data_1646927590127/work
|
||||
statsmodels @ file:///tmp/build/80754af9/statsmodels_1648015433305/work
|
||||
sympy @ file:///tmp/build/80754af9/sympy_1647853653589/work
|
||||
tables @ file:///tmp/build/80754af9/pytables_1607975397488/work
|
||||
tabulate==0.8.9
|
||||
tarsafe==0.0.3
|
||||
TBB==0.2
|
||||
tblib @ file:///Users/ktietz/demo/mc3/conda-bld/tblib_1629402031467/work
|
||||
tenacity @ file:///tmp/build/80754af9/tenacity_1626248292117/work
|
||||
tensorboard==2.11.2
|
||||
tensorboard-data-server==0.6.1
|
||||
tensorboard-plugin-wit==1.8.1
|
||||
tensorflow==2.11.0
|
||||
tensorflow-addons==0.19.0
|
||||
tensorflow-estimator==2.11.0
|
||||
tensorflow-hub==0.12.0
|
||||
tensorflow-io-gcs-filesystem==0.32.0
|
||||
tensorflow-text==2.11.0
|
||||
termcolor==2.2.0
|
||||
terminado @ file:///tmp/build/80754af9/terminado_1644322582718/work
|
||||
terminaltables==3.1.10
|
||||
testpath @ file:///tmp/build/80754af9/testpath_1624638946665/work
|
||||
text-unidecode @ file:///Users/ktietz/demo/mc3/conda-bld/text-unidecode_1629401354553/work
|
||||
textdistance @ file:///tmp/build/80754af9/textdistance_1612461398012/work
|
||||
threadpoolctl @ file:///Users/ktietz/demo/mc3/conda-bld/threadpoolctl_1629802263681/work
|
||||
three-merge @ file:///tmp/build/80754af9/three-merge_1607553261110/work
|
||||
tifffile @ file:///tmp/build/80754af9/tifffile_1627275862826/work
|
||||
tinycss @ file:///tmp/build/80754af9/tinycss_1617713798712/work
|
||||
tldextract @ file:///opt/conda/conda-bld/tldextract_1646638314385/work
|
||||
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
|
||||
tomli @ file:///tmp/build/80754af9/tomli_1637314251069/work
|
||||
toolz @ file:///tmp/build/80754af9/toolz_1636545406491/work
|
||||
tornado @ file:///tmp/build/80754af9/tornado_1606942317143/work
|
||||
tqdm @ file:///opt/conda/conda-bld/tqdm_1650891076910/work
|
||||
traitlets @ file:///tmp/build/80754af9/traitlets_1636710298902/work
|
||||
twilio==7.14.2
|
||||
Twisted @ file:///tmp/build/80754af9/twisted_1646835200521/work
|
||||
typed-ast @ file:///tmp/build/80754af9/typed-ast_1624953673314/work
|
||||
typeguard==3.0.2
|
||||
typing-utils==0.1.0
|
||||
typing_extensions==4.5.0
|
||||
tzdata==2023.3
|
||||
tzlocal==4.3
|
||||
ujson @ file:///tmp/build/80754af9/ujson_1648025916270/work
|
||||
Unidecode @ file:///tmp/build/80754af9/unidecode_1614712377438/work
|
||||
urllib3==1.26.15
|
||||
uvloop==0.17.0
|
||||
w3lib @ file:///Users/ktietz/demo/mc3/conda-bld/w3lib_1629359764703/work
|
||||
watchdog @ file:///tmp/build/80754af9/watchdog_1638367282716/work
|
||||
wcwidth @ file:///Users/ktietz/demo/mc3/conda-bld/wcwidth_1629357192024/work
|
||||
webencodings==0.5.1
|
||||
webexteamssdk==1.6.1
|
||||
websocket-client @ file:///tmp/build/80754af9/websocket-client_1614803975924/work
|
||||
websockets==10.4
|
||||
Werkzeug @ file:///opt/conda/conda-bld/werkzeug_1645628268370/work
|
||||
widgetsnbextension @ file:///tmp/build/80754af9/widgetsnbextension_1644992802045/work
|
||||
wrapt @ file:///tmp/build/80754af9/wrapt_1607574498026/work
|
||||
wurlitzer @ file:///tmp/build/80754af9/wurlitzer_1638368168359/work
|
||||
xarray @ file:///opt/conda/conda-bld/xarray_1639166117697/work
|
||||
xlrd @ file:///tmp/build/80754af9/xlrd_1608072521494/work
|
||||
XlsxWriter @ file:///opt/conda/conda-bld/xlsxwriter_1649073856329/work
|
||||
yapf @ file:///tmp/build/80754af9/yapf_1615749224965/work
|
||||
yarl @ file:///tmp/build/80754af9/yarl_1606939947528/work
|
||||
zict==2.0.0
|
||||
zipp @ file:///opt/conda/conda-bld/zipp_1641824620731/work
|
||||
zope.interface @ file:///tmp/build/80754af9/zope.interface_1625036153595/work
|
||||
Flask==3.0.0
|
||||
importlib-metadata==7.0.1
|
||||
itsdangerous==2.1.2
|
||||
Jinja2==3.1.2
|
||||
MarkupSafe==2.1.3
|
||||
numpy==1.24.4
|
||||
opencv-python==4.9.0.80
|
||||
pillow==10.2.0
|
||||
pytz==2023.3.post1
|
||||
Werkzeug==3.0.1
|
||||
zipp==3.17.0
|
||||
+122
-1033
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,18 @@
|
||||
# Use an official Python runtime as a parent image
|
||||
FROM python:3.8.10
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /opt/bussinesscards
|
||||
|
||||
# Copy the current directory contents into the container at /usr/src/app
|
||||
COPY . .
|
||||
|
||||
# Install any needed packages specified in requirements.txt
|
||||
RUN apt update && apt install -y libgl1-mesa-glx && apt --fix-broken install && \
|
||||
pip install --no-cache-dir -r requirement.txt
|
||||
|
||||
# Make port 80 available to the world outside this container
|
||||
EXPOSE 1112
|
||||
|
||||
# Run app.py when the container launches
|
||||
CMD ["python", "./Business_cards.py"]
|
||||
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
# Use an official Python runtime as a parent image
|
||||
FROM python:3.8.10
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /opt/forcasting
|
||||
|
||||
# Copy the current directory contents into the container at /usr/src/app
|
||||
COPY . .
|
||||
|
||||
# Install any needed packages specified in requirements.txt
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Make port 80 available to the world outside this container
|
||||
EXPOSE 8082
|
||||
|
||||
# Run app.py when the container launches
|
||||
CMD ["python", "./forcasting.py"]
|
||||
@@ -0,0 +1,101 @@
|
||||
journaldate,sum,itemid,itemname
|
||||
31-12-2021,1.0,101000000023776,175/70R14 Assurancer TripleMax 84H TL
|
||||
31-12-2021,3.0,101000000024158,205/55R16 Assurance TripleMax 91V TL
|
||||
31-12-2021,624.0,101000000015442,"MOBIL GLYGOYLE 680, 208 LT DRUM"
|
||||
31-12-2021,35.0,101000000037808,MOBILUBE GX 80W-90 PAIL 7L:IN
|
||||
31-12-2021,37.5,101000000047447,MOBIL DEL MX PLUS 15W-40 PL7.5L:IN-DP 2
|
||||
31-12-2021,7.0,101000000055448,205/55R17 91H ASSU TRIPLEMAX2 TL
|
||||
31-12-2020,224.0,101000000051526,MOBIL SUPER 1000 5W-30 CTN 4X3.5L:IN-CP
|
||||
31-12-2020,2562.0,101000000052959,MOBIL SUPER 3000 FI 5W-40 CTN 4X3.5L:IN-CP
|
||||
31-12-2020,7.0,101000000052695,MOBIL SUPER 1000 5W-30 PAIL 7L:IN-CP
|
||||
31-12-2020,1908.0,101000000051952,MOBIL SUPER 1000 5W-30 CTN 6X3L:IN-CP
|
||||
31-12-2020,80.0,101000000052367,M-SUP 1000 DIESEL 15W-40 CTN 4X5L:IN-CP
|
||||
31-12-2020,14.0,101000000052877,MOBIL SUPER XHP 10W-40 CTN 4X3.5L:IN-CP
|
||||
31-12-2020,20.0,101000000052769,MOBIL SUPER 1000 5W-30 CTN 4X5L:IN-CP
|
||||
31-12-2020,36.0,101000000053493,Mobil SUPER 3000 X1 FOR FE 5W30 CTN 6X3L:IN-CP
|
||||
31-12-2020,5.0,101000000023164,185 / 65R15 ASSURANCE TRIPLEMAX 88H TL
|
||||
31-12-2020,14.0,101000000008239,MOBIL SUPER MGDO 5W-40 CTN 4X3.5L:IN
|
||||
31-12-2020,36.0,101000000018815,MOBIL DELVAC TM G CH-4 15W-40 CTN 6X3L:IN
|
||||
31-12-2020,20.0,101000000019616,MOBIL DELVAC TM G CI-4PLUS 15W-40 CTN 20X1L:IN
|
||||
31-12-2020,11.0,101000000021875,145 / 80R12 DUCARO HI-MILER 74T TL
|
||||
31-12-2020,696.0,101000000012556,MOBILITH SHC 220 384LB(174KG) DRUM METAL
|
||||
31-12-2020,624.0,101000000014368,NUTO H 68 DRUM 208L:IN
|
||||
31-12-2020,225.0,101000000016839,MOBIL DELVAC TM G CI-4PLUS 15W-40 PAIL 15L:IN
|
||||
31-12-2020,60.0,101000000009015,MOBILUBE GX 80W-90 CTN 20X1L:IN
|
||||
31-12-2020,4.0,101000000023637,175/65R14 ASSURANCE DURAPLUS 82T/H TL
|
||||
31-12-2020,416.0,101000000005360,MOBIL SUPER HP 10W-30 DRUM 208L:IN
|
||||
31-12-2020,4.0,101000000024284,185/70R14 88T ASSURANCE TRIPLEMAX
|
||||
31-12-2020,16.0,101000000008576,MOBIL SUPER MGDO 5W-40 CTN 4X4L:IN
|
||||
31-12-2020,30.0,101000000010000,MOBILUBE GX 80W-90 CTN 6X2.5L:IN
|
||||
31-12-2020,208.0,101000000007290,MOBIL SUPER MGDO 5W-40 DRUM 208L:IN
|
||||
31-12-2020,36.0,101000000019696,MOBIL DELVAC TM G CI-4PLUS 15W-40 CTN 6X3L:IN
|
||||
31-12-2020,94.5,101000000013094,"MOBIL SHC 630,5GA"
|
||||
31-12-2020,1040.0,101000000020132,MOBIL DELVAC TM G CI-4PLUS 15W-40 DRUM 208L:IN
|
||||
31-12-2020,180.0,101000000019180,MOBIL DELVAC TM G CH-4 15W-40 PAIL 15L:IN
|
||||
31-12-2020,16.0,101000000012337,MOBILGREASE XHP 222 PAIL 16KG:SG
|
||||
31-12-2020,96.0,101000000004891,MOBIL SUPER HP 10W-30 CTN 4X4L:IN
|
||||
31-12-2020,1.0,101000000022771,175 / 65R15 ASSURANCE TRIPLEMAX 84T TL
|
||||
31-12-2020,2250.0,101000000017961,MOBIL DELVAC TM G CF-4 15W-40 PAIL 7.5L:IN
|
||||
31-12-2020,546.0,101000000006445,MOBIL SUPER MGDO 15W-40 CTN 4X3.5L:IN
|
||||
31-12-2020,52.0,101000000024014,185/60R15 Assurancer TripleMax 84H TL
|
||||
31-12-2020,20.0,101000000017132,MOBIL DELVAC TM G CF-4 15W-40 CTN 20X1L:IN
|
||||
31-12-2020,20.0,101000000010612,MOBILUBE HD 85W-140 CTN 20X1L:IN
|
||||
31-12-2020,82.0,101000000003319,MOBIL SUPER 3000 FORMULA I 5W-40 CTN 12X1L:IN
|
||||
31-12-2020,756.0,101000000017549,MOBIL DELVAC TM G CF-4 15W-40 CTN 6X3L:IN
|
||||
31-12-2020,2436.0,101000000046656,"MOBILITH SHC 221, 174KG/383.6LB DR"
|
||||
31-12-2020,24.0,101000000035381,MOBIL DELVAC LONG LIFE GREASE CTN 24X0.5KG - cap promo
|
||||
31-12-2020,252.0,101000000044266,MOBIL SPECIAL 20W-50 CTN 6X3L:IN-SL_old
|
||||
31-12-2020,4.0,101000000031812,195/60R16 89H ASSURANCE TRIPLEMAX
|
||||
31-12-2020,15.0,101000000048094,CO-1G Green Coolant 1:3 For all cars
|
||||
31-12-2020,24.0,101000000035646,MOBIL DELVAC LL GREASE CTN 12X1KG:IN
|
||||
31-12-2020,208.0,101000000028407,MOBIL SUPER 3000 TMGO 5W-30 DRUM 208L:IN
|
||||
31-12-2020,100.0,101000000046925,MOBILGEAR EP 460 PAIL 20L:IN
|
||||
31-12-2020,120.0,101000000038034,MOBILUBE HD 85W-140 PAIL 12L:IN
|
||||
31-12-2020,828.0,101000000046225,MOBIL SUPER MOTO 20W-40 CTN 20X0.9L:IN
|
||||
31-12-2020,38.4,101000000034876,MOBIL SUPER MOTO SCOOTER 10W-30 CTN 12X0.8L:IN - cap promo
|
||||
31-12-2020,352.0,101000000045383,"MOBIL POLYREX EM, 16KG PAIL"
|
||||
31-12-2020,12.0,101000000034710,MOBIL SUPER MOTO 10W-30 CTN 12X1L:IN - cap promo
|
||||
31-12-2020,98.0,101000000036159,MOBIL DELVAC LONG LIFE GREASE PAIL 7KG - cap promo
|
||||
31-12-2020,130.0,101000000037398,MOBIL DELVAC LONG LIFE GREASE CTN 2X5KG - cap promo
|
||||
31-12-2020,2.0,101000000027610,175 / 70R14 DURAPLUS 84H / T TL
|
||||
31-12-2020,1.0,101000000027409,195 / 55R16 ASSURANCE TRIPLEMAX 87V / H TL
|
||||
31-12-2020,24.0,101000000036366,MOBIL DELVAC LONG LIFE GREASE CTN 6X2KG - cap promo
|
||||
31-12-2020,172.5,101000000043516,MOBIL DEL TRACTOR SONA 20W-40 PL 7.5L:IN
|
||||
31-12-2020,36.0,101000000035874,MOBIL DELVAC LONG LIFE GREASE CTN 4X3KG - cap promo
|
||||
31-12-2020,48.0,101000000033625,MOBIL SUPER MOTO 10W-40 CTN 12X1L:IN - cap promo
|
||||
31-12-2020,168.0,101000000046999,ECSTAR F9000 FULLY SYN 0W20 CTN4X3.5L:IN
|
||||
31-12-2020,20.0,101000000046554,MOBIL SUPER MOTO 20W-40 CTN 20X1L:IN
|
||||
31-12-2020,2.0,101000000026452,205 / 55R16 EAGLE NCT5 91V RHD (4RIB)
|
||||
31-12-2020,50.0,101000000042528,MOBIL SUPER MOTO 20W-40 PAIL 50L:IN
|
||||
31-12-2020,1.0,101000000046772,165/70R14 81T ASSURANCE TRIPLEMAX
|
||||
31-12-2020,345.6,101000000034474,MOBIL SUPER MOTO 10W-30 CTN 12X0.9L:IN - cap promo
|
||||
31-12-2020,1.0,101000000048926,LED3 H7 40W Light
|
||||
31-12-2020,300.0,101000000043708,MOBIL SUP MOTO SYN TEC15W50 CTN6X2.5L:IN
|
||||
31-12-2020,126.0,101000000037723,MOBILUBE GX 80W-90 PAIL 7L:IN
|
||||
31-12-2019,2.0,101000000039144,4.00-10 CONTI TUFF OT
|
||||
31-12-2019,1372.0,101000000029156,MOBIL SUPER 3000 FORMULA I 5W-40 CTN 4X3.5L:IN
|
||||
31-12-2019,3.0,101000000039699,90/90-17 CONTI MOTO TL
|
||||
31-12-2019,8.0,101000000038954,90/100-10 CONTI GRIPP TL
|
||||
31-12-2019,3.0,101000000040882,2.75-18 CONTI RIB TT
|
||||
31-12-2019,28.0,101000000041514,2.75/3.00X18 Metro Conti M/Cy.Tube
|
||||
31-12-2019,5.0,101000000040259,2.75-18 CONTI RIB OT
|
||||
31-12-2019,97.2,101000000034054,MOBIL SUPER MOTO 20W-40 CTN 12X0.9L:IN - cap promo
|
||||
31-12-2019,70.0,101000000041365,3.50-8 NAVIGATOR TT
|
||||
31-12-2019,154.0,101000000030504,MOBIL SUPER 3000 X1 FORMULA FE 5W-30 CTN4X3.5L:IN
|
||||
31-12-2019,594.0,101000000044022,MOBIL SPECIAL 20W-50 CTN 6X3L:IN-SL_old
|
||||
31-12-2019,70.0,101000000041800,3.50X8 Metro Conti Scooter Tube
|
||||
31-12-2019,1.0,101000000040053,150/60R-17 CONTI BAZOOKA TL
|
||||
31-12-2019,165.0,101000000036917,MOBIL DELVAC TM GEN CF-4 15W-40 PAIL 7.5L:IN - cap promo
|
||||
31-12-2019,10.0,101000000045728,215/65R16 98H WRANGLER AT SILENTTR
|
||||
31-12-2019,80.0,101000000037327,MOBIL DELVAC LONG LIFE GREASE CTN 2X5KG - cap promo
|
||||
31-12-2019,72.0,101000000042279,MOBIL DELVAC SUPER 1400 15W-40 CT6X3L:IN
|
||||
31-12-2019,1.0,101000000039857,110/70-17 CONTI GO! TL
|
||||
31-12-2019,25.0,101000000041025,2.75-18 CONTI TOOFANI-2 TT
|
||||
31-12-2019,36.0,101000000035603,MOBIL DELVAC LL GREASE CTN 12X1KG:IN
|
||||
31-12-2019,36.0,101000000035310,MOBIL DELVAC LONG LIFE GREASE CTN 24X0.5KG - cap promo
|
||||
31-12-2019,6.0,101000000041663,2.75/3.00X17 Metro Conti M/Cy.Tube
|
||||
31-12-2019,270.0,101000000045114,MOBIL DEL MX PLUS 15W-40 PL 15L:IN - DP
|
||||
31-12-2019,60.0,101000000029380,MOBIL DELVAC MX PLUS 15W-40 CTN 20X1L:IN
|
||||
31-12-2019,388.8,101000000034330,MOBIL SUPER MOTO 10W-30 CTN 12X0.9L:IN - cap promo
|
||||
31-12-2019,36.0,101000000036328,MOBIL DELVAC LONG LIFE GREASE CTN 6X2KG - cap promo
|
||||
31-12-2019,5.0,101000000042066,185/55R16 87H ASSURANCE TRIPLEMAX
|
||||
|
File diff suppressed because one or more lines are too long
+629
-606
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,561 @@
|
||||
from flask import Flask, render_template, send_file, request, redirect, Response
|
||||
import os
|
||||
import pandas as pd
|
||||
import warnings
|
||||
import json
|
||||
import requests
|
||||
from urllib.request import urlopen
|
||||
warnings.filterwarnings("ignore")
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/", methods=["GET"])
|
||||
def home():
|
||||
return 'forcasting app running'
|
||||
|
||||
######################################################################################################################
|
||||
list_output=[]
|
||||
|
||||
def day(Num,get_url,get_url_token,post_url,post_url_token):
|
||||
|
||||
import requests
|
||||
|
||||
url = get_url
|
||||
|
||||
payload = {}
|
||||
headers = {
|
||||
'Authorization': get_url_token
|
||||
}
|
||||
|
||||
response = requests.request("GET", url, headers=headers, data=payload)
|
||||
#a=response.text
|
||||
# print(response.text)
|
||||
|
||||
import pandas as pd
|
||||
|
||||
df2 = pd.read_json(response.text, orient ='index')
|
||||
df2=df2.reset_index()
|
||||
df2.columns = ['key','value']
|
||||
#print(df2)
|
||||
a=df2['value'][0]
|
||||
|
||||
j=json.loads(a)
|
||||
userdata = pd.DataFrame(j)
|
||||
#df1
|
||||
itemid=userdata[['itemname','itemid']]
|
||||
itemid.columns = ['ItemName', 'ItemId']
|
||||
|
||||
#df1=pd.read_csv(r'./upload/' + name)
|
||||
#df1=df1[df1['obdate']!='01/01/0001']
|
||||
userdata.columns = ['journaldate','sum','itemid','itemname']
|
||||
|
||||
|
||||
# import pandas as pd
|
||||
# userdata = pd.read_csv(r'C:\Users\Bizga\Desktop\forcast\5yearsitems.csv')
|
||||
# itemid = userdata[['itemname', 'itemid']]
|
||||
#userdata['journaldate'] = pd.to_datetime(userdata['journaldate'])
|
||||
userdata["journaldate"] = userdata["journaldate"].astype(str)
|
||||
#userdata[["year", "month", "day"]] = userdata["journaldate"].str.split("/", expand = True)
|
||||
userdata[[ "day","month","year", ]] = userdata["journaldate"].str.split("-", expand = True)
|
||||
#userdata['Month-Year']=userdata['year'].astype(str)+'-'+userdata['month'].astype(str)
|
||||
item_unique_name = userdata['itemname'].unique()
|
||||
|
||||
#df=pd.read_csv("C:\\Users\\Bizgaze\\2021_2022.csv")
|
||||
# Group the DataFrame by the 'item' column
|
||||
grouped = userdata.groupby('itemname')
|
||||
|
||||
# Print the unique items in the 'item' column
|
||||
#print(grouped.groups.keys())
|
||||
|
||||
# Iterate over the unique items and print the group data
|
||||
for item, userdata in grouped:
|
||||
print("itemname: ", item)
|
||||
|
||||
item_id = userdata.iloc[-1]['itemid']
|
||||
|
||||
print(item_id)
|
||||
|
||||
userdata= userdata.groupby('journaldate').sum()
|
||||
userdata= userdata.reset_index()
|
||||
#print(userdata)
|
||||
fulldata=userdata[['journaldate','sum']]
|
||||
fulldata.columns = ["Dates","SALES"]
|
||||
#************************************************************************************************************************
|
||||
|
||||
## Use Techniques Differencing
|
||||
import pandas as pd
|
||||
from pandas import DataFrame
|
||||
|
||||
|
||||
# userdata=pd.read_csv(r"C:\Users\Bizgaze\ipynb files\TS forcasting\working\139470.csv")
|
||||
userdata=userdata[['journaldate','sum','itemid']]
|
||||
userdata.columns = ['Date', 'sales','sku']
|
||||
from statsmodels.tsa.stattools import adfuller
|
||||
|
||||
DATE=[]
|
||||
SALES=[]
|
||||
|
||||
|
||||
def adf_test(series,userdata):
|
||||
result=adfuller(series)
|
||||
print('ADF Statistics: {}'.format(result[0]))
|
||||
print('p- value: {}'.format(result[1]))
|
||||
if result[1] <= 0.05:
|
||||
print("strong evidence against the null hypothesis, reject the null hypothesis. Data has no unit root and is stationary")
|
||||
else:
|
||||
#print(userdata)
|
||||
print(stationary_test(userdata))
|
||||
print("weak evidence against null hypothesis, time series has a unit root, indicating it is non-stationary ")
|
||||
|
||||
#********************************************* stationary or non-stationary **********************************************************
|
||||
def stationary_test(userdata):
|
||||
data=pd.DataFrame(userdata)
|
||||
for i in range(1,13):
|
||||
print(i)
|
||||
sales_data=DataFrame()
|
||||
data['sales']=data['sales'].shift(i)
|
||||
data.dropna(inplace=True)
|
||||
#print( userdata['sales'])
|
||||
try:
|
||||
X=adf_test(data["sales"],userdata="nothing")
|
||||
if "non-stationary" in str(X):
|
||||
print("non-stationary")
|
||||
else:
|
||||
print("stationary")
|
||||
#print(userdata[["Date","sales"]])
|
||||
#df_sale=pd.DataFrame(userdata)
|
||||
DATE.append(data["Date"])
|
||||
SALES.append(data["sales"])
|
||||
#df4 = pd.concat([data, sales_data], axis=1)
|
||||
return "done"
|
||||
break
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
try:
|
||||
adf_test(userdata["sales"],userdata)
|
||||
except ValueError:
|
||||
pass
|
||||
sales=pd.DataFrame(SALES).T
|
||||
dates=pd.DataFrame(DATE).T
|
||||
try:
|
||||
df4 = pd.concat([dates["Date"],sales["sales"]], axis=1)
|
||||
df4=df4.dropna()
|
||||
print(df4)
|
||||
except KeyError:
|
||||
df4=userdata[['Date','sales']]
|
||||
df4=df4.dropna()
|
||||
print(df4)
|
||||
pass
|
||||
|
||||
#####################################################################################################################
|
||||
userdata=df4
|
||||
a = userdata.iloc[-1]['Date']
|
||||
|
||||
#userdata['Date'] = pd.to_datetime(userdata['Date'])
|
||||
userdata["Date"] = userdata["Date"].astype(str)
|
||||
print('after testing')
|
||||
print(userdata)
|
||||
userdata[["year", "month", "day"]] = userdata["Date"].str.split("-", expand = True)
|
||||
#userdata[["year", "month"]] = userdata["Month"].str.split("-", expand=True)
|
||||
#userdata = userdata[["year","month",'sum']]
|
||||
userdata["year"] = userdata["year"].astype(int)
|
||||
userdata["month"] = userdata["month"].astype(int)
|
||||
userdata["day"] = userdata["day"].astype(int)
|
||||
#####################################################################################################################
|
||||
|
||||
|
||||
list_dates=[]
|
||||
import datetime
|
||||
|
||||
days=int(Num)+1
|
||||
import pandas as pd
|
||||
base_date=pd.to_datetime(a)
|
||||
for x in range(1,days):
|
||||
dates=(base_date + datetime.timedelta(days=x))
|
||||
dates=str(dates).replace(" 00:00:00","")
|
||||
#print(dates)
|
||||
list_dates.append(dates)
|
||||
fut_date = pd.DataFrame(list_dates)
|
||||
fut_date.columns = ["Dates"]
|
||||
|
||||
future_dates=pd.DataFrame(list_dates)
|
||||
|
||||
future_dates.columns=["Dates"]
|
||||
future_dates[["year", "month", "day"]] = future_dates["Dates"].str.split("-", expand=True)
|
||||
future_dates.drop(['Dates'], axis=1, inplace=True)
|
||||
future_dates["year"] = future_dates["year"].astype(int)
|
||||
future_dates["month"] = future_dates["month"].astype(int)
|
||||
future_dates["day"] = future_dates["day"].astype(int)
|
||||
#print(future_dates)
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
userdata['sales']=userdata["sales"].astype(float)
|
||||
dependent = userdata[['year','month','day']]
|
||||
independent = userdata['sales']
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
import xgboost
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.model_selection import GridSearchCV
|
||||
from sklearn.metrics import roc_auc_score
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
#model = xgboost.XGBRegressor()
|
||||
from sklearn.ensemble import RandomForestRegressor
|
||||
model = RandomForestRegressor(random_state=1,n_jobs=-1)
|
||||
#model.fit(dependent, independent)
|
||||
model.fit(dependent, independent)
|
||||
#future=pd.read_csv('future_dates.csv')
|
||||
|
||||
|
||||
future_prediction = model.predict(future_dates)
|
||||
#print(future_prediction)
|
||||
df=pd.DataFrame(future_prediction)
|
||||
df.columns = ["SALES"]
|
||||
frames = [fut_date, df]
|
||||
|
||||
|
||||
result = pd.concat(frames,axis=1)
|
||||
result['itemname'] = item
|
||||
result['itemid'] =item_id
|
||||
result.columns = ['Date','Predict','ItemName','ItemId']
|
||||
#result['Predict']=result["Predict"].astype(int)
|
||||
result['UpperLimit']=result["Predict"].mean()+result['Predict'].std()*3
|
||||
result['LowerLimit']=result['Predict'].mean()-result['Predict'].std()*3
|
||||
print(result)
|
||||
result.to_json('forcast.json', orient="records")
|
||||
|
||||
|
||||
with open('forcast.json', 'r') as json_file:
|
||||
json_load = json.load(json_file)
|
||||
#url = "https://demo.bizgaze.app/apis/v4/bizgaze/integrations/demandforecast/saveforecast/List"
|
||||
url=post_url
|
||||
|
||||
payload = json.dumps(json_load)#.replace("]", "").replace("[", "")
|
||||
print(payload)
|
||||
#print(payload)
|
||||
headers = {
|
||||
#'Authorization': 'stat 263162e61f084d3392f162eb7ec39b2c',#demo
|
||||
'Authorization': post_url_token,#test
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
# print("##############################################################")
|
||||
print(response.text)
|
||||
|
||||
|
||||
return 'done'
|
||||
|
||||
|
||||
|
||||
#############################################################################################################################################################
|
||||
|
||||
|
||||
def month(Num,get_url,get_url_token,post_url,post_url_token):
|
||||
#url='https://qa.bizgaze.app/apis/v4/bizgaze/integrations/demandforecast/getitemdata'
|
||||
# url= get_url
|
||||
# response = urlopen(url)
|
||||
# data_json = json.loads(response.read())
|
||||
# headers = {
|
||||
# 'Authorization':get_url_token,
|
||||
# #'Authorization':'stat 873f2e6f70b3483e983972f96fbf5ea4',#qa
|
||||
# 'Content-Type': 'application/json'
|
||||
# }
|
||||
# response = requests.request("GET", url, headers=headers, data=data_json)
|
||||
# #print("##############################################################")
|
||||
# a=response.text
|
||||
# # print(response.text)
|
||||
import requests
|
||||
|
||||
url = get_url
|
||||
|
||||
payload = {}
|
||||
headers = {
|
||||
'Authorization': get_url_token
|
||||
}
|
||||
|
||||
response = requests.request("GET", url, headers=headers, data=payload)
|
||||
|
||||
#print(response.text)
|
||||
|
||||
import pandas as pd
|
||||
|
||||
df2 = pd.read_json(response.text, orient ='index')
|
||||
df2=df2.reset_index()
|
||||
df2.columns = ['key','value']
|
||||
#print(df2)
|
||||
a=df2['value'][0]
|
||||
|
||||
j=json.loads(a)
|
||||
userdata = pd.DataFrame(j)
|
||||
|
||||
#filePath='path.csv'
|
||||
# if os.path.exists(filePath):
|
||||
# print('file exist')
|
||||
# os.remove('path.csv')
|
||||
# else:
|
||||
# print("file doesn't exists")
|
||||
# pass
|
||||
#userdata=df
|
||||
itemid=userdata[['itemname','itemid']]
|
||||
itemid.columns = ['ItemName', 'ItemId']
|
||||
|
||||
#df1=pd.read_csv(r'./upload/' + name)
|
||||
#df1=df1[df1['obdate']!='01/01/0001']
|
||||
userdata.columns = ['journaldate','sum','itemid','itemname']
|
||||
# import pandas as pd
|
||||
# userdata = pd.read_csv(r'C:\Users\Bizga\Desktop\forcast\5yearsitems.csv')
|
||||
# itemid = userdata[['itemname', 'itemid']]
|
||||
#userdata['journaldate'] = pd.to_datetime(userdata['journaldate'])
|
||||
userdata["journaldate"] = userdata["journaldate"].astype(str)
|
||||
#userdata[["year", "month", "day"]] = userdata["journaldate"].str.split("-", expand = True)
|
||||
userdata[[ "day","month","year", ]] = userdata["journaldate"].str.split("-", expand = True)
|
||||
#userdata[["year", "day", "month"]] = userdata["journaldate"].str.split("/", expand=True)
|
||||
userdata['Month-Year']=userdata['year'].astype(str)+'-'+userdata['month'].astype(str)
|
||||
item_unique_name = userdata['itemname'].unique()
|
||||
|
||||
#df=pd.read_csv("C:\\Users\\Bizgaze\\2021_2022.csv")
|
||||
# Group the DataFrame by the 'item' column
|
||||
grouped = userdata.groupby('itemname')
|
||||
|
||||
# Print the unique items in the 'item' column
|
||||
#print(grouped.groups.keys())
|
||||
|
||||
# Iterate over the unique items and print the group data
|
||||
for item, userdata in grouped:
|
||||
print("itemname: ", item)
|
||||
|
||||
item_id = userdata.iloc[-1]['itemid']
|
||||
|
||||
print(item_id)
|
||||
|
||||
userdata= userdata.groupby('Month-Year').sum()
|
||||
userdata= userdata.reset_index()
|
||||
|
||||
fulldata=userdata[['Month-Year','sum']]
|
||||
fulldata.columns = ["Dates","SALES"]
|
||||
#************************************************************************************************************************
|
||||
|
||||
## Use Techniques Differencing
|
||||
import pandas as pd
|
||||
from pandas import DataFrame
|
||||
|
||||
# userdata=pd.read_csv(r"C:\Users\Bizgaze\ipynb files\TS forcasting\working\139470.csv")
|
||||
userdata=userdata[['Month-Year','sum','itemid']]
|
||||
userdata.columns = ['Month', 'sales','sku']
|
||||
from statsmodels.tsa.stattools import adfuller
|
||||
|
||||
DATE=[]
|
||||
SALES=[]
|
||||
|
||||
|
||||
def adf_test(series,userdata):
|
||||
result=adfuller(series)
|
||||
print('ADF Statistics: {}'.format(result[0]))
|
||||
print('p- value: {}'.format(result[1]))
|
||||
if result[1] <= 0.05:
|
||||
print("strong evidence against the null hypothesis, reject the null hypothesis. Data has no unit root and is stationary")
|
||||
else:
|
||||
#print(userdata)
|
||||
print(stationary_test(userdata))
|
||||
print("weak evidence against null hypothesis, time series has a unit root, indicating it is non-stationary ")
|
||||
|
||||
|
||||
#********************************************* stationary or non-stationary **********************************************************
|
||||
def stationary_test(userdata):
|
||||
data=pd.DataFrame(userdata)
|
||||
for i in range(1,13):
|
||||
print(i)
|
||||
sales_data=DataFrame()
|
||||
data['sales']=data['sales'].shift(i)
|
||||
data.dropna(inplace=True)
|
||||
#print( userdata['sales'])
|
||||
try:
|
||||
X=adf_test(data["sales"],userdata="nothing")
|
||||
if "non-stationary" in str(X):
|
||||
print("non-stationary")
|
||||
else:
|
||||
print("stationary")
|
||||
#print(userdata[["Month","sales"]])
|
||||
#df_sale=pd.DataFrame(userdata)
|
||||
DATE.append(data["Month"])
|
||||
SALES.append(data["sales"])
|
||||
#df4 = pd.concat([data, sales_data], axis=1)
|
||||
return "done"
|
||||
break
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
try:
|
||||
adf_test(userdata["sales"],userdata)
|
||||
except ValueError:
|
||||
pass
|
||||
sales=pd.DataFrame(SALES).T
|
||||
dates=pd.DataFrame(DATE).T
|
||||
try:
|
||||
df4 = pd.concat([dates["Month"],sales["sales"]], axis=1)
|
||||
df4=df4.dropna()
|
||||
print(df4)
|
||||
except KeyError:
|
||||
df4=userdata[['Month','sales']]
|
||||
df4=df4.dropna()
|
||||
print(df4)
|
||||
pass
|
||||
|
||||
#####################################################################################################################
|
||||
userdata=df4
|
||||
a = userdata.iloc[-1]['Month']
|
||||
userdata[["year", "month"]] = userdata["Month"].str.split("-", expand=True)
|
||||
#userdata = userdata[["year","month",'sum']]
|
||||
userdata["year"] = userdata["year"].astype(int)
|
||||
userdata["month"] = userdata["month"].astype(int)
|
||||
#####################################################################################################################
|
||||
|
||||
#a = userdata.iloc[-1]['Month-Year']
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
import pandas as pd
|
||||
months_value = int(Num)+1
|
||||
base_month = pd.to_datetime(a)
|
||||
list_months = []
|
||||
|
||||
def months(MD):
|
||||
date_after_month = ((base_month + relativedelta(months=MD)).strftime('%Y-%m'))
|
||||
# print
|
||||
list_months.append(date_after_month)
|
||||
|
||||
for i in range(1, months_value):
|
||||
months(i)
|
||||
|
||||
future_dates = pd.DataFrame(list_months)
|
||||
|
||||
future_dates.columns = ["Dates"]
|
||||
|
||||
fut_date = pd.DataFrame(list_months)
|
||||
fut_date.columns = ["Dates"]
|
||||
|
||||
future_dates[["year", "month"]] = future_dates["Dates"].str.split("-", expand=True)
|
||||
future_dates.drop(['Dates'], axis=1, inplace=True)
|
||||
future_dates["year"] = future_dates["year"].astype(int)
|
||||
future_dates["month"] = future_dates["month"].astype(int)
|
||||
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
userdata['sales']=userdata["sales"].astype(float)
|
||||
dependent = userdata[['year','month']]
|
||||
independent = userdata['sales']
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
import xgboost
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.model_selection import GridSearchCV
|
||||
from sklearn.metrics import roc_auc_score
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
#model = xgboost.XGBRegressor()
|
||||
from sklearn.ensemble import RandomForestRegressor
|
||||
model = RandomForestRegressor(random_state=1,n_jobs=-1)
|
||||
model.fit(dependent, independent)
|
||||
#future=pd.read_csv('future_dates.csv')
|
||||
|
||||
|
||||
future_prediction = model.predict(future_dates)
|
||||
#print(future_prediction)
|
||||
df=pd.DataFrame(future_prediction)
|
||||
df.columns = ["SALES"]
|
||||
frames = [fut_date, df]
|
||||
|
||||
|
||||
result = pd.concat(frames,axis=1)
|
||||
result['itemname'] = item
|
||||
result['itemid'] =item_id
|
||||
result.columns = ['Date','Predict','ItemName','ItemId']
|
||||
#result['Predict']=result["Predict"].astype(int)
|
||||
result['UpperLimit']=result["Predict"].mean()+result['Predict'].std()*3
|
||||
result['LowerLimit']=result['Predict'].mean()-result['Predict'].std()*3
|
||||
result["LowerLimit"][result["LowerLimit"] < 0] = 0
|
||||
print(result)
|
||||
result.to_json('forcast.json', orient="records")
|
||||
|
||||
with open('forcast.json', 'r') as json_file:
|
||||
json_load = json.load(json_file)
|
||||
#url = "https://demo.bizgaze.app/apis/v4/bizgaze/integrations/demandforecast/saveforecast/List"
|
||||
url=post_url
|
||||
|
||||
payload = json.dumps(json_load)#.replace("]", "").replace("[", "")
|
||||
print(payload)
|
||||
#print(payload)
|
||||
headers = {
|
||||
#'Authorization': 'stat 263162e61f084d3392f162eb7ec39b2c',#demo
|
||||
'Authorization': post_url_token,#test
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
# print("##############################################################")
|
||||
print(response.text)
|
||||
|
||||
|
||||
#output={"response":"success","result":json_data}
|
||||
#print(output)
|
||||
return 'done'
|
||||
|
||||
|
||||
|
||||
###############################################################################################################################################################
|
||||
|
||||
#####################################################################################################################
|
||||
|
||||
@app.route("/sales_forcast", methods=["GET", "POST"])
|
||||
def sales_forcast():
|
||||
#wise= request.args.get('wise').replace('{','').replace('}','')
|
||||
#Num= request.args.get('value').replace('{','').replace('}','')
|
||||
#print(wise)
|
||||
#print(Num)
|
||||
Dataset = request.get_json()
|
||||
a = Dataset
|
||||
wise = a['wise']
|
||||
# print(x)
|
||||
Num = a['future_dates']
|
||||
get_url = a['get_url']
|
||||
get_url_token = a['get_url_token']
|
||||
post_url = a['post_url']
|
||||
post_url_token = a['post_url_token']
|
||||
|
||||
#print(Dataset)
|
||||
# import pandas as pd
|
||||
# df=pd.DataFrame(Dataset)
|
||||
# print(df)
|
||||
# a = Dataset
|
||||
#x = a['wise']
|
||||
# cmd = "python C:\\Users\\Bizga\\Desktop\\forcast\\XGdaywise.py"
|
||||
# os.system(cmd)
|
||||
|
||||
#split=wise
|
||||
# wise='month'
|
||||
# Num=5
|
||||
if wise=='days':
|
||||
print('daywise groupby')
|
||||
output=day(Num,get_url,get_url_token,post_url,post_url_token)
|
||||
# cmd = "python C:\\Users\\Bizga\\Desktop\\forcast\\XGdaywise.py"+" "+ Num
|
||||
# os.system(cmd)
|
||||
else:
|
||||
print('monthwise groupby')
|
||||
output=month(Num,get_url,get_url_token,post_url,post_url_token)
|
||||
# payload = json.dumps(output)
|
||||
# payload_list="["+payload+"]"
|
||||
|
||||
return output
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host='0.0.0.0', port=8082)
|
||||
Binary file not shown.
@@ -0,0 +1,35 @@
|
||||
certifi==2022.12.7
|
||||
charset-normalizer==3.1.0
|
||||
click==8.1.3
|
||||
contourpy==1.0.7
|
||||
cycler==0.11.0
|
||||
Flask==2.2.3
|
||||
fonttools==4.39.3
|
||||
idna==3.4
|
||||
importlib-metadata==6.3.0
|
||||
importlib-resources==5.12.0
|
||||
itsdangerous==2.1.2
|
||||
Jinja2==3.1.2
|
||||
joblib==1.2.0
|
||||
kiwisolver==1.4.4
|
||||
MarkupSafe==2.1.2
|
||||
matplotlib==3.7.1
|
||||
numpy==1.24.2
|
||||
packaging==23.0
|
||||
pandas==2.0.0
|
||||
patsy==0.5.3
|
||||
Pillow==9.5.0
|
||||
pyparsing==3.0.9
|
||||
python-dateutil==2.8.2
|
||||
pytz==2023.3
|
||||
requests==2.28.2
|
||||
scikit-learn==1.2.2
|
||||
scipy==1.10.1
|
||||
six==1.16.0
|
||||
statsmodels==0.13.5
|
||||
threadpoolctl==3.1.0
|
||||
tzdata==2023.3
|
||||
urllib3==1.26.15
|
||||
Werkzeug==2.2.3
|
||||
xgboost==1.7.5
|
||||
zipp==3.15.0
|
||||
@@ -0,0 +1,18 @@
|
||||
# Use an official Python runtime as a parent image
|
||||
FROM python:3.8.10
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /opt/events
|
||||
|
||||
# Copy the current directory contents into the container at /opt/attendance
|
||||
COPY . .
|
||||
|
||||
# Install any needed packages specified in requirements.txt
|
||||
RUN apt update && apt install -y libgl1-mesa-glx && apt --fix-broken install && \
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Make port 8081 available to the world outside this container
|
||||
EXPOSE 8081
|
||||
|
||||
# Run app.py when the container launches
|
||||
CMD ["python", "./myproject.py"]
|
||||
@@ -0,0 +1,419 @@
|
||||
import pickle
|
||||
import numpy as np
|
||||
import face_recognition
|
||||
import os
|
||||
from flask import Flask, render_template, request, redirect, send_file
|
||||
#import shutil
|
||||
import cv2
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
#datasetPath = "/opt/bizgaze/events.bizgaze.app/wwwroot/_files/1/Gallery/"
|
||||
#peoplePath = "/opt/bizgaze/events.bizgaze.app/wwwroot/_files/People/"
|
||||
|
||||
|
||||
|
||||
|
||||
@app.route('/', methods=['GET'])
|
||||
def home():
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
|
||||
@app.route('/predict', methods=["GET", "POST"])
|
||||
def predict():
|
||||
Dataset = request.get_json()
|
||||
a = Dataset
|
||||
peoplePath = a['People']
|
||||
|
||||
#print(peoplePath1)
|
||||
datasetPath = a['Gallery']
|
||||
|
||||
#print(datasetPath)
|
||||
|
||||
print('starting')
|
||||
def saveEncodings(encs, names, fname="encodings.pickle"):
|
||||
print('encoding')
|
||||
"""
|
||||
Save encodings in a pickle file to be used in future.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
encs : List of np arrays
|
||||
List of face encodings.
|
||||
names : List of strings
|
||||
List of names for each face encoding.
|
||||
fname : String, optional
|
||||
Name/Location for pickle file. The default is "encodings.pickle".
|
||||
|
||||
Returns
|
||||
-------
|
||||
None.
|
||||
|
||||
"""
|
||||
|
||||
data = []
|
||||
d = [{"name": nm, "encoding": enc} for (nm, enc) in zip(names, encs)]
|
||||
data.extend(d)
|
||||
|
||||
encodingsFile = fname
|
||||
|
||||
# dump the facial encodings data to disk
|
||||
print("[INFO] serializing encodings...")
|
||||
f = open(encodingsFile, "wb")
|
||||
f.write(pickle.dumps(data))
|
||||
f.close()
|
||||
|
||||
# Function to read encodings
|
||||
|
||||
def readEncodingsPickle(fname):
|
||||
"""
|
||||
Read Pickle file.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
fname : String
|
||||
Name of pickle file.(Full location)
|
||||
|
||||
Returns
|
||||
-------
|
||||
encodings : list of np arrays
|
||||
list of all saved encodings
|
||||
names : List of Strings
|
||||
List of all saved names
|
||||
|
||||
"""
|
||||
|
||||
data = pickle.loads(open(fname, "rb").read())
|
||||
data = np.array(data)
|
||||
encodings = [d["encoding"] for d in data]
|
||||
names = [d["name"] for d in data]
|
||||
return encodings, names
|
||||
|
||||
# Function to create encodings and get face locations
|
||||
def createEncodings(image):
|
||||
"""
|
||||
Create face encodings for a given image and also return face locations in the given image.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
image : cv2 mat
|
||||
Image you want to detect faces from.
|
||||
|
||||
Returns
|
||||
-------
|
||||
known_encodings : list of np array
|
||||
List of face encodings in a given image
|
||||
face_locations : list of tuples
|
||||
list of tuples for face locations in a given image
|
||||
|
||||
"""
|
||||
|
||||
# Find face locations for all faces in an image
|
||||
face_locations = face_recognition.face_locations(image)
|
||||
|
||||
# Create encodings for all faces in an image
|
||||
known_encodings = face_recognition.face_encodings(image, known_face_locations=face_locations)
|
||||
return known_encodings, face_locations
|
||||
|
||||
# Function to compare encodings
|
||||
def compareFaceEncodings(unknown_encoding, known_encodings, known_names):
|
||||
"""
|
||||
Compares face encodings to check if 2 faces are same or not.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
unknown_encoding : np array
|
||||
Face encoding of unknown people.
|
||||
known_encodings : np array
|
||||
Face encodings of known people.
|
||||
known_names : list of strings
|
||||
Names of known people
|
||||
|
||||
Returns
|
||||
-------
|
||||
acceptBool : Bool
|
||||
face matched or not
|
||||
duplicateName : String
|
||||
Name of matched face
|
||||
distance : Float
|
||||
Distance between 2 faces
|
||||
|
||||
"""
|
||||
duplicateName = ""
|
||||
distance = 0.0
|
||||
matches = face_recognition.compare_faces(known_encodings, unknown_encoding, tolerance=0.47)
|
||||
face_distances = face_recognition.face_distance(known_encodings, unknown_encoding)
|
||||
best_match_index = np.argmin(face_distances)
|
||||
distance = face_distances[best_match_index]
|
||||
if matches[best_match_index]:
|
||||
acceptBool = True
|
||||
duplicateName = known_names[best_match_index]
|
||||
else:
|
||||
acceptBool = False
|
||||
duplicateName = ""
|
||||
return acceptBool, duplicateName, distance
|
||||
|
||||
p = []
|
||||
|
||||
# Save Image to new directory
|
||||
def saveImageToDirectory(image, name, imageName):
|
||||
"""
|
||||
Saves images to directory.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
image : cv2 mat
|
||||
Image you want to save.
|
||||
name : String
|
||||
Directory where you want the image to be saved.
|
||||
imageName : String
|
||||
Name of image.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None.
|
||||
|
||||
"""
|
||||
path = "./output/" + name
|
||||
path1 = "./output/" + name
|
||||
if os.path.exists(path):
|
||||
pass
|
||||
else:
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
# os.mkdir(path,exist_ok=True)
|
||||
cv2.imwrite(path + "/" + imageName, image)
|
||||
x = []
|
||||
c = (path1 + "/" + imageName)
|
||||
x.append(c)
|
||||
p.append(x)
|
||||
|
||||
# Function for creating encodings for known people
|
||||
def processKnownPeopleImages(path=peoplePath, saveLocation="./known_encodings.pickle"):
|
||||
"""
|
||||
Process images of known people and create face encodings to compare in future.
|
||||
Eaach image should have just 1 face in it.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
path : STRING, optional
|
||||
Path for known people dataset. The default is "C:/inetpub/vhosts/port82/wwwroot/_files/People".
|
||||
It should be noted that each image in this dataset should contain only 1 face.
|
||||
saveLocation : STRING, optional
|
||||
Path for storing encodings for known people dataset. The default is "./known_encodings.pickle in current directory".
|
||||
|
||||
Returns
|
||||
-------
|
||||
None.
|
||||
|
||||
"""
|
||||
|
||||
known_encodings = []
|
||||
known_names = []
|
||||
for img in os.listdir(path):
|
||||
imgPath = path + img
|
||||
|
||||
# Read image
|
||||
image = cv2.imread(imgPath)
|
||||
name = img.rsplit('.')[0]
|
||||
# Resize
|
||||
image = cv2.resize(image, (0, 0), fx=0.9, fy=0.9, interpolation=cv2.INTER_LINEAR)
|
||||
|
||||
# Get locations and encodings
|
||||
encs, locs = createEncodings(image)
|
||||
try:
|
||||
known_encodings.append(encs[0])
|
||||
except IndexError:
|
||||
pass
|
||||
known_names.append(name)
|
||||
|
||||
for loc in locs:
|
||||
top, right, bottom, left = loc
|
||||
|
||||
# Show Image
|
||||
#cv2.rectangle(image, (left, top), (right, bottom), color=(255, 0, 0), thickness=2)
|
||||
# cv2.imshow("Image", image)
|
||||
# cv2.waitKey(1)
|
||||
#cv2.destroyAllWindows()
|
||||
saveEncodings(known_encodings, known_names, saveLocation)
|
||||
|
||||
# Function for processing dataset images
|
||||
def processDatasetImages(saveLocation="./Gallery_encodings.pickle"):
|
||||
"""
|
||||
Process image in dataset from where you want to separate images.
|
||||
It separates the images into directories of known people, groups and any unknown people images.
|
||||
Parameters
|
||||
----------
|
||||
path : STRING, optional
|
||||
Path for known people dataset. The default is "D:/port1004/port1004/wwwroot/_files/People".
|
||||
It should be noted that each image in this dataset should contain only 1 face.
|
||||
saveLocation : STRING, optional
|
||||
Path for storing encodings for known people dataset. The default is "./known_encodings.pickle in current directory".
|
||||
|
||||
Returns
|
||||
-------
|
||||
None.
|
||||
|
||||
"""
|
||||
# Read pickle file for known people to compare faces from
|
||||
people_encodings, names = readEncodingsPickle("./known_encodings.pickle")
|
||||
|
||||
for root, dirs, files in os.walk(datasetPath, topdown=False):
|
||||
|
||||
for name in files:
|
||||
s = os.path.join(root, name)
|
||||
#print(p)
|
||||
# imgPath = path + img
|
||||
|
||||
# Read image
|
||||
image = cv2.imread(s)
|
||||
orig = image.copy()
|
||||
|
||||
# Resize
|
||||
image = cv2.resize(image, (0, 0), fx=0.9, fy=0.9, interpolation=cv2.INTER_LINEAR)
|
||||
|
||||
# Get locations and encodings
|
||||
encs, locs = createEncodings(image)
|
||||
|
||||
# Save image to a group image folder if more than one face is in image
|
||||
# if len(locs) > 1:
|
||||
# saveImageToDirectory(orig, "Group", img)
|
||||
|
||||
# Processing image for each face
|
||||
i = 0
|
||||
knownFlag = 0
|
||||
for loc in locs:
|
||||
top, right, bottom, left = loc
|
||||
unknown_encoding = encs[i]
|
||||
i += 1
|
||||
acceptBool, duplicateName, distance = compareFaceEncodings(unknown_encoding, people_encodings, names)
|
||||
if acceptBool:
|
||||
saveImageToDirectory(orig, duplicateName,name)
|
||||
knownFlag = 1
|
||||
if knownFlag == 1:
|
||||
print("Match Found")
|
||||
else:
|
||||
saveImageToDirectory(orig, "0",name)
|
||||
|
||||
# Show Image
|
||||
# cv2.rectangle(image, (left, top), (right, bottom), color=(255, 0, 0), thickness=2)
|
||||
# # cv2.imshow("Image", image)
|
||||
# cv2.waitKey(1)
|
||||
# cv2.destroyAllWindows()
|
||||
|
||||
|
||||
def main():
|
||||
"""
|
||||
Main Function.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None.
|
||||
|
||||
"""
|
||||
|
||||
processKnownPeopleImages(peoplePath)
|
||||
processDatasetImages(datasetPath)
|
||||
# shutil.make_archive('./Images', 'zip','./output')
|
||||
# p='./Images.zip'
|
||||
# return send_file(p,as_attachment=True)
|
||||
|
||||
|
||||
# import pandas as pd
|
||||
# q = pd.DataFrame(p)
|
||||
# x = q
|
||||
# # x.drop(x.columns[0], axis=1, inplace=True)
|
||||
# df = x.groupby([0], as_index=False).count()
|
||||
# z = df[0].str.split('/', expand=True)
|
||||
|
||||
|
||||
# for i, group in z.groupby([2]):
|
||||
# group.drop(group.columns[2], axis=1, inplace=True)
|
||||
#group.to_csv(f'./output1/{i}.csv', index=False, sep='/', header=False)
|
||||
|
||||
|
||||
##############################csv creation code ##############################
|
||||
import pandas as pd
|
||||
q = pd.DataFrame(p)
|
||||
m = q
|
||||
#print(m)
|
||||
# x.drop(x.columns[Unnam], axis=1, inplace=True)
|
||||
df = m.groupby([0], as_index=False).count()
|
||||
first_column_name = df.columns[0]
|
||||
|
||||
# Rename the first column
|
||||
df.rename(columns={first_column_name: 'col'}, inplace=True)
|
||||
#print(df)
|
||||
z = df['col'].str.split('/', expand=True)
|
||||
z['ImagePath'] = z[3]
|
||||
|
||||
result = z.drop([0,1,3], axis=1)
|
||||
result.rename({result.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||
# print(result)
|
||||
result.to_csv('results1.csv')
|
||||
import pandas as pd
|
||||
import os
|
||||
c = []
|
||||
for root, dirs, files in os.walk(datasetPath, topdown=False):
|
||||
for name in files:
|
||||
# print(name)
|
||||
L = os.path.join(root, name)
|
||||
c.append(L)
|
||||
df = pd.DataFrame(c)
|
||||
#print('seconfdf')
|
||||
|
||||
first_column_name = df.columns[0]
|
||||
|
||||
# Rename the first column
|
||||
df.rename(columns={first_column_name: 'col'}, inplace=True)
|
||||
print(df)
|
||||
df1 = df['col'].str.split("\\", expand=True)
|
||||
df1.rename({df1.columns[-2]: 'abc'}, axis=1, inplace=True)
|
||||
#print('this is df1')
|
||||
#print(df1)
|
||||
df1.rename({df1.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||
merge = pd.merge(df1, result, on='test', how='left')
|
||||
merge.to_csv('merge.csv')
|
||||
mergesplit = merge.loc[:,'test'].str.split(".", expand=True)
|
||||
mergesplit.rename({mergesplit.columns[-2]: 'ImageName'}, axis=1, inplace=True)
|
||||
mergesplit = mergesplit.loc[:,'ImageName' ]
|
||||
|
||||
merge.rename({merge.columns[-1]: 'Matched'}, axis=1, inplace=True)
|
||||
merge['EventName'] = merge['abc']
|
||||
merge['Imagepath']= datasetPath+merge['EventName']+'/'+ + merge['test']
|
||||
|
||||
frames = [merge, mergesplit]
|
||||
|
||||
r = pd.concat(frames, axis=1, join='inner')
|
||||
r=r.iloc[:,3:]
|
||||
#print(r)
|
||||
r.to_csv('path.csv', index=False)
|
||||
#r.to_json(r'./matched.json', orient="records")
|
||||
column_list = ['Matched','Imagepath', 'ImageName', 'EventName']
|
||||
r[column_list].to_json('matched.json', orient="records")
|
||||
|
||||
#############################################################################################
|
||||
|
||||
print("Completed")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
# return render_template('index.html')
|
||||
p = './matched.json'
|
||||
return send_file(p,as_attachment=True)
|
||||
|
||||
# return 'ALL IMAGES MATCHED'
|
||||
|
||||
|
||||
@app.route('/json')
|
||||
def json():
|
||||
p = './matched.json'
|
||||
return send_file(p,as_attachment=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0",port=8081)
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
certifi==2022.12.7
|
||||
charset-normalizer==3.1.0
|
||||
click==8.1.3
|
||||
contourpy==1.0.7
|
||||
cycler==0.11.0
|
||||
Flask==2.2.3
|
||||
fonttools==4.39.3
|
||||
idna==3.4
|
||||
importlib-metadata==6.3.0
|
||||
importlib-resources==5.12.0
|
||||
itsdangerous==2.1.2
|
||||
Jinja2==3.1.2
|
||||
joblib==1.2.0
|
||||
kiwisolver==1.4.4
|
||||
MarkupSafe==2.1.2
|
||||
matplotlib==3.7.1
|
||||
numpy==1.24.2
|
||||
packaging==23.0
|
||||
pandas==2.0.0
|
||||
patsy==0.5.3
|
||||
Pillow==9.5.0
|
||||
pyparsing==3.0.9
|
||||
python-dateutil==2.8.2
|
||||
pytz==2023.3
|
||||
requests==2.28.2
|
||||
scikit-learn==1.2.2
|
||||
scipy==1.10.1
|
||||
six==1.16.0
|
||||
statsmodels==0.13.5
|
||||
threadpoolctl==3.1.0
|
||||
tzdata==2023.3
|
||||
urllib3==1.26.15
|
||||
Werkzeug==2.2.3
|
||||
xgboost==1.7.5
|
||||
zipp==3.15.0
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -407,6 +407,6 @@ def upload_resume():
|
||||
return results[0]
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host='0.0.0.0', port=5003, debug=True)
|
||||
app.run(host='0.0.0.0', port=1113, debug=True)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user