feat: add development and maintenance utilities

pyav_udp_test.py:
- Simple UDP packet receiver for testing data flow
- Frame shape validation and debugging

reprocess_metadata.py:
- Batch metadata regeneration for existing images
- Gradient generation from stored image files
- JSONL metadata format with duplicate detection
This commit is contained in:
2025-11-16 00:51:24 +02:00
committed by ro
parent 2ab014c88c
commit fff9c8c140
2 changed files with 120 additions and 0 deletions

16
pyav_udp_test.py Normal file
View File

@@ -0,0 +1,16 @@
import socket
import numpy as np
"udp://10.81.2.120:5000"
#10.81.2.183
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(("0.0.0.0", 5000))
COLUMN_HEIGHT, COLUMN_WIDTH, CHANNELS = 2456, 1, 3 # Example dimensions, adjust as needed
while True:
data, addr = sock.recvfrom(65536) # buffer size is 65536 bytes
#print(f"Received {len(data)} bytes from {addr}")
frame = np.frombuffer(data, dtype=np.uint8).reshape((COLUMN_HEIGHT, COLUMN_WIDTH, CHANNELS))
print(frame.shape)