Skip to content

Commit

Permalink
Merge pull request #1 from Sid220/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
Sid220 committed Sep 25, 2023
2 parents 10362a1 + bcd231d commit 6ce833a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Login to docker
shell: bash
env:
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
run: docker login --password "$DOCKER_PASS" --username "sid220"
- name: Create and enter builder
run: docker buildx create --name apriltag-builder && docker buildx use apriltag-builder
- name: Build the Docker image
run: docker buildx build --platform linux/amd64,linux/arm64 -t sid220/apriltag_localisation:latest -t sid220/apriltag_localisation:$(date +%s) --push .
- uses: actions/checkout@v3
- name: Bump version
run: |
git config --global user.email "github+actions@gmail.com"
git config --global user.name "Actions"
git fetch --tags
wget -O - https://raw.githubusercontent.com/treeder/bump/master/gitbump.sh | bash
- name: Login to docker
shell: bash
env:
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
run: docker login --password "$DOCKER_PASS" --username "sid220"
- name: Create and enter builder
run: docker buildx create --name apriltag-builder && docker buildx use apriltag-builder
- name: Build the Docker image
run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t sid220/apriltag_localisation:latest -t sid220/apriltag_localisation:$(git tag --sort=-v:refname --list "v[0-9]*" | head -n 1 | cut -c 2-) --push .
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# docker-apriltag-localisation
# Docker AprilTag Localisation
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/sid220/docker-apriltag-localisation/docker-image.yml?logo=github&label=build) ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/sid220/apriltag_localisation/latest?logo=docker) ![Docker Pulls](https://img.shields.io/docker/pulls/sid220/apriltag_localisation?logo=docker)

Large-scale apriltag localisation for edge devices.

Installation instructions coming soon...
18 changes: 14 additions & 4 deletions client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import time

import redis
import numpy as np
import cv2
Expand All @@ -7,18 +9,26 @@
from src.helpers.redis_mgr import RedisHandler

redis_info = get_redis_info(False)
redis = redis.Redis(host="localhost", port=redis_info["port"])
assert redis.ping()
not_connected = True
while not_connected:
try:
redis_client = redis.Redis(host="localhost", port=redis_info["port"])
assert redis_client.ping()
not_connected = False
except (redis.exceptions.ConnectionError, AssertionError):
print("Waiting for Redis")
time.sleep(2)
continue

buffer = CircularBuffer(10)

l = redis.xread({"tvecs_stream": "$"}, block=0)
l = redis_client.xread({"tvecs_stream": "$"}, block=0)
while True:
print("New Loop")
print(l)

last_id_returned = l[0][1][-1][0]
l = redis.xread({"tvecs_stream": last_id_returned}, count=10, block=0)
l = redis_client.xread({"tvecs_stream": last_id_returned}, count=10, block=0)
print(l)

translation_vectors = RedisHandler.arr_from_redis(l[0][1][0][1][b'tvecs'])
Expand Down

0 comments on commit 6ce833a

Please sign in to comment.