Skip to content

Commit

Permalink
Fix supporting the new color detection
Browse files Browse the repository at this point in the history
  • Loading branch information
GlennDeLoose01 committed Jun 4, 2024
1 parent d274ca8 commit af7d711
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data/video.mp4
assets/videos/video.mp4
__pycache__
.venv
.env
20 changes: 11 additions & 9 deletions example_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,17 @@
# In this example, we will perform color prediction on the first frame of
# the video
print("5) Perform action on the media... (in this case color prediction)")
main_colors, _, _ = ColorPrediction.find_main_colors(image=read_first_frame('data/video.mp4'),
min_clusters=1,
max_clusters=5,
downsample_factor=0.95,
increase_elbow=0,
verbose=False,
plot=False)
print("\tMain colors found in the first frame:", main_colors.tolist())
ColorPrediction.find_main_colors(
image=read_first_frame('data/video.mp4'),
min_clusters=1,
max_clusters=8,
downsample_factor=0.95,
increase_elbow=0,
verbose=True,
plot=False)

# Cleanup the video
print("6) Cleaning up the video...")
os.remove('data/video.mp4')
os.remove('data/video.mp4')
print()

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opencv-python
python-dotenv
uugai-python-color-prediction>=1.3.0
uugai-python-color-prediction>=2.2.0
uugai-python-dynamic-queue>=1.1.0
uugai-python-kerberos-vault>=1.2.0

0 comments on commit af7d711

Please sign in to comment.