Skip to content
Snippets Groups Projects
Commit 615c7d77 authored by Andrews Sobral's avatar Andrews Sobral
Browse files

Updated python demo script. Added virtualenv scripts for easy build and test the pybgs package.

parent ad670019
No related branches found
No related tags found
No related merge requests found
......@@ -30,3 +30,5 @@ bgslibrary_gui
upload.sh
*.code-workspace
env
bgslibrary_env
bgslibrary_test_env
......@@ -45,13 +45,23 @@ algorithms.append(bgs.PAWCS())
algorithms.append(bgs.TwoPoints())
algorithms.append(bgs.ViBe())
algorithms.append(bgs.CodeBook())
algorithms.append(bgs.FuzzySugenoIntegral())
algorithms.append(bgs.FuzzyChoquetIntegral())
algorithms.append(bgs.LBSimpleGaussian())
algorithms.append(bgs.LBFuzzyGaussian())
algorithms.append(bgs.LBMixtureOfGaussians())
algorithms.append(bgs.LBAdaptiveSOM())
algorithms.append(bgs.LBFuzzyAdaptiveSOM())
algorithms.append(bgs.VuMeter())
algorithms.append(bgs.KDE())
algorithms.append(bgs.IndependentMultimodal())
if is_cv2():
algorithms.append(bgs.MixtureOfGaussianV1()) # if opencv 2.x
algorithms.append(bgs.GMG()) # if opencv 2.x
if is_cv3():
algorithms.append(bgs.KNN()) # if opencv 3.x
if not is_cv2():
algorithms.append(bgs.KNN()) # if opencv > 2
if is_cv2() or is_cv3():
algorithms.append(bgs.DPAdaptiveMedian())
......@@ -66,16 +76,6 @@ if is_cv2() or is_cv3():
algorithms.append(bgs.T2FGMM_UV())
algorithms.append(bgs.T2FMRF_UM())
algorithms.append(bgs.T2FMRF_UV())
algorithms.append(bgs.FuzzySugenoIntegral())
algorithms.append(bgs.FuzzyChoquetIntegral())
algorithms.append(bgs.LBSimpleGaussian())
algorithms.append(bgs.LBFuzzyGaussian())
algorithms.append(bgs.LBMixtureOfGaussians())
algorithms.append(bgs.LBAdaptiveSOM())
algorithms.append(bgs.LBFuzzyAdaptiveSOM())
algorithms.append(bgs.VuMeter())
algorithms.append(bgs.KDE())
algorithms.append(bgs.IndependentMultimodal())
algorithms.append(bgs.MultiCue())
if is_cv2() or is_lower_or_equals_cv347():
......@@ -93,7 +93,7 @@ if (len(sys.argv) == 2):
video_file = "dataset/video.avi"
print("Number of available algorithms: ", len(algorithms))
for algorithm in algorithms:
print("Running ", algorithm.__class__)
......
# Remove the existing virtual environment if it exists
rm -rf bgslibrary_env
# Create a new virtual environment called bgslibrary_env using Python3
python3 -m venv bgslibrary_env
# Activate the newly created virtual environment
source bgslibrary_env/bin/activate
# Upgrade pip and install required packages numpy and OpenCV
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install numpy
python -m pip install opencv-python
# Build and install the package using the setup.py script
python setup.py build
python setup.py install
# Set the PYTHONPATH environment variable to the build directory to access the installed library
# The following line is for Linux
export PYTHONPATH=$PYTHONPATH:$PWD/build/lib.linux-x86_64-cpython-38
# The following line is for Mac
export PYTHONPATH=$PYTHONPATH:$PWD/build/lib.macosx-11-x86_64-cpython-39
# Run demo.py and demo2.py to verify the package installation
python demo.py
python demo2.py
# Install the Twine package for uploading the distribution packages
python -m pip install twine
# Remove any existing build directory
rm -rf build/*
# Build a Wheel distribution package for the project
python setup.py bdist_wheel
# Upload any generated Wheel distribution packages using Twine
twine upload dist/*.whl
# Create a source distribution package for the project
python setup.py sdist
# Upload the generated source distribution package using Twine
twine upload dist/pybgs-*.tar.gz
# Remove the existing virtual environment if it exists
rm -rf bgslibrary_test_env
# Create a new virtual environment called bgslibrary_test_env using Python3
python3 -m venv bgslibrary_test_env
# Activate the newly created virtual environment
source bgslibrary_test_env/bin/activate
# Upgrade pip and install required packages numpy and OpenCV
python -m pip install --upgrade pip
python -m pip install numpy
python -m pip install opencv-python
# Build and install the package using the setup.py script
# python setup.py build
# python setup.py install
# Set the PYTHONPATH environment variable to the build directory to access the installed library
# The following line is for Linux
# export PYTHONPATH=$PYTHONPATH:$PWD/build/lib.linux-x86_64-cpython-38
# The following line is for Mac
# export PYTHONPATH=$PYTHONPATH:$PWD/build/lib.macosx-11-x86_64-cpython-39
# Install the pybgs directly from PyPI
python -m pip install pybgs
# Run demo.py and demo2.py to verify the package installation
python demo.py
python demo2.py
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment