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
16 lines
562 B
Python
16 lines
562 B
Python
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) |