You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the directory images/
Two fake cameras have been created. The code is available in containers/dev_reolink and reolink_dev2. In both camera there is the following code which will download 4 images if the images/ directory doesn't exist:
# Get a list of image filenames in the directory
image_dir = "data/images"
images_name = [
"1465065360_-00240.jpg",
"1465065780_+00180.jpg",
"1465066800_+01200.jpg",
"1465068000_+02400.jpg",
]
url = "https://github.com/pyronear/pyro-devops/releases/download/v0.0.1/"
if not os.path.isfile(image_dir):
os.makedirs(image_dir, exist_ok=True)
for name in images_name:
print(f"Downloading images from {url + name} ...")
urlretrieve(url + name, image_dir + "/" + name)
Which means that both camera are using the same test images. When a GET call is done to @app.route("/cgi-bin/api.cgi") the images are sent back one after another.
static vs PTZ
The configuration file of the camera is : data/credentials.json. You can see that reolink_dev is a static camera and reolink_dev2 is a ptz camera with two poses, which means that the camera can move between two poses in order to capture images from two different point of view
The only difference in the fake camera implementation is that the ptz camera has a second route @app.route("/cgi-bin/api.cgi", methods=["POST"]) which send automatically a 200. In real camera this route is used to move the camera between poses.
Wanted Behavior
Renaming the cameras
Instead of reolink_dev and directory dev_reolink it would be better to have something like test_camera_static and test_camera_ptz
Not using the same images/ directory
Instead of checking if the directory exist we should create and commit three directories :
data/test_images_static/
data/test_images_ptz_pose1/
data/test_images_ptz_pose2/
In the python code, check that they are empty. If not, download the images as we already did. For the PTZ camera, each time the POST route is used, changed the directory used from _pose1 to _pose2.
The text was updated successfully, but these errors were encountered:
Current Behavior
Two fake cameras have been created. The code is available in containers/dev_reolink and reolink_dev2. In both camera there is the following code which will download 4 images if the images/ directory doesn't exist:
Which means that both camera are using the same test images. When a GET call is done to
@app.route("/cgi-bin/api.cgi")
the images are sent back one after another.The configuration file of the camera is : data/credentials.json. You can see that reolink_dev is a static camera and reolink_dev2 is a ptz camera with two poses, which means that the camera can move between two poses in order to capture images from two different point of view
The only difference in the fake camera implementation is that the ptz camera has a second route
@app.route("/cgi-bin/api.cgi", methods=["POST"])
which send automatically a 200. In real camera this route is used to move the camera between poses.Wanted Behavior
Renaming the cameras
Instead of reolink_dev and directory dev_reolink it would be better to have something like test_camera_static and test_camera_ptz
Not using the same images/ directory
Instead of checking if the directory exist we should create and commit three directories :
data/test_images_static/
data/test_images_ptz_pose1/
data/test_images_ptz_pose2/
In the python code, check that they are empty. If not, download the images as we already did. For the PTZ camera, each time the POST route is used, changed the directory used from _pose1 to _pose2.
The text was updated successfully, but these errors were encountered: