Skip to content

Commit

Permalink
minor improvements (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnadler86 committed Oct 29, 2024
1 parent 5d993e5 commit 28cd904
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/benchmark.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from camera import Camera, FrameSize, PixelFormat
import time
import gc
import os
gc.enable()

def measure_fps(duration=2):
Expand All @@ -19,8 +20,9 @@ def measure_fps(duration=2):
fps = frame_count / (end_time - start_time)
return fps

def print_summary_table(results):
print("\nSummary Table (FPS values):")
def print_summary_table(results, cam):
(_,_,_,_,target) = os.uname()
print(f"\nBenchmark {target} with {cam.get_sensor_name()}, fb_count: {cam.get_fb_count()}, GrabMode: {cam.get_grab_mode()}:")

pixel_formats = list(results.keys())
print(f"{'Frame Size':<15}", end="")
Expand Down
1 change: 1 addition & 0 deletions src/micropython.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CAMERA_MOD_DIR := $(USERMOD_DIR)
SRC_USERMOD_C += $(addprefix $(CAMERA_MOD_DIR)/, modcamera_api.c)
SRC_USERMOD_C += $(addprefix $(CAMERA_MOD_DIR)/, mod_img_convertes.c)
SRC_USERMOD_LIB_C += $(addprefix $(CAMERA_MOD_DIR)/, modcamera.c)
CFLAGS_USERMOD += -I$(CAMERA_MOD_DIR)

0 comments on commit 28cd904

Please sign in to comment.