Skip to main content

AWS Panorama

AWS Panorama คือบริการที่นำ computer vision มาทำงานบน edge devices ในสถานที่จริง เช่น โรงงาน คลังสินค้า หรือร้านค้า โดยไม่ต้องส่งวิดีโอทั้งหมดขึ้น cloud Panorama Appliance เป็น hardware device ที่ติดตั้ง on-premise และรับ video streams จาก IP cameras หลายตัวพร้อมกัน ประมวลผล ML inference ในสถานที่ ทำให้ได้ผลลัพธ์แบบ real-time โดยไม่มีปัญหา latency หรือ bandwidth

บริการนี้ช่วยให้องค์กรสามารถ deploy computer vision models ที่พัฒนาจาก Amazon SageMaker หรือ third-party frameworks เช่น TensorFlow, PyTorch และ ONNX ไปยัง edge ได้อย่างง่ายดาย รองรับ use cases เช่น quality inspection, safety compliance, inventory monitoring, people counting และ process optimization

AWS Docs: https://docs.aws.amazon.com/panorama/latest/dev/panorama-welcome.html

สถาปัตยกรรม


ฟีเจอร์หลัก

Panorama Appliance (Hardware Device)

AWS Panorama Appliance เป็น purpose-built edge computing device ที่ประกอบด้วย NVIDIA GPU สำหรับ AI inference, รองรับการเชื่อมต่อกล้อง RTSP หลายช่อง, มี hardware security module สำหรับ encrypted storage และรองรับ OTA software updates ผ่าน AWS

Panorama-Enabled Cameras

นอกจาก Appliance แล้ว ยังรองรับ Panorama-enabled cameras จาก partners เช่น VIVOTEK และ Ambarella ซึ่ง run ML models ได้โดยตรงบน camera chip โดยไม่ต้องใช้ Appliance แยกต่างหาก

Deploy CV Models to Edge

Deploy computer vision models จาก SageMaker หรือ model zoo ไปยัง Panorama Appliance ผ่าน AWS Console หรือ CLI โดยอัตโนมัติ ระบบจัดการ packaging, signing และ deployment ให้ทั้งหมด

Run Multiple Models Simultaneously

รัน ML models หลายตัวพร้อมกันบน appliance เดียว เช่น ใช้ object detection model ตรวจจับสินค้า พร้อมกับ anomaly detection model ตรวจจับข้อบกพร่อง บน video stream เดียวกัน

Local Processing (No Cloud Latency)

ประมวลผล inference บน edge โดยตรง ทำให้ได้ผลลัพธ์ใน milliseconds เหมาะสำหรับ use cases ที่ต้องการ real-time response เช่น การตรวจสอบคุณภาพบนสายการผลิตที่เคลื่อนที่เร็ว หรือการแจ้งเตือนด้านความปลอดภัยทันที

Model Packaging and Deployment

AWS Panorama SDK ช่วยในการ package model และ application code เป็น container ที่พร้อม deploy โดยใช้ command เดียว ระบบ version control ทำให้ rollback ได้ง่ายหากเกิดปัญหา

Access Camera Streams (RTSP)

เชื่อมต่อกับ IP cameras ที่รองรับ RTSP protocol ซึ่งเป็นมาตรฐาน industry ไม่จำกัดยี่ห้อ รองรับ H.264, H.265 และ MJPEG ทำให้ใช้กล้องที่มีอยู่แล้วในโรงงานได้โดยไม่ต้องเปลี่ยน

Integration with S3 and Lambda for Results

ส่งผลลัพธ์ inference เช่น detected objects, bounding boxes, confidence scores ไปยัง S3 หรือ trigger Lambda function เพื่อ downstream processing เช่น การ alert, การบันทึก, หรือการ integrate กับ ERP/MES systems

Partner Devices Support

รองรับ partner devices จากบริษัทต่างๆ ที่ผ่านการรับรองจาก AWS ทำให้มีตัวเลือก hardware หลายระดับราคาและ specification ตามความต้องการ


การติดตั้งและการตั้งค่า

เปิดใช้งานผ่าน Console

  1. เข้า AWS Console > AWS Panorama
  2. Register Panorama Appliance ด้วย activation code
  3. Configure network (LAN สำหรับเชื่อมกล้อง, WAN สำหรับ AWS)
  4. Add camera streams (RTSP URLs)
  5. Deploy application package ที่มี ML model
  6. Monitor results บน Console หรือ downstream systems

ติดตั้ง Panorama SDK

pip install panoramacli
panorama-cli --version

โครงสร้างโปรเจกต์ Panorama

my-cv-app/
├── packages/
│ └── 123456789-my_model-1.0/
│ ├── descriptor.json
│ ├── package.json
│ └── model/
│ └── model.tar.gz
├── graphs/
│ └── my-graph/
│ └── graph.json
└── assets/
└── camera-streams.json

IAM Permissions ที่จำเป็น

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"panorama:*",
"s3:GetObject",
"s3:PutObject",
"iam:PassRole",
"sagemaker:DescribeModel"
],
"Resource": "*"
}
]
}

วิธีใช้งาน

สร้าง Panorama Application

# application_code.py - รันบน Panorama Appliance
import panoramasdk
import cv2
import numpy as np
import boto3
import json

class QualityInspectionApp(panoramasdk.node):

def __init__(self):
super().__init__()
self.model = None
self.s3_client = boto3.client('s3')
self.defect_count = 0

def process_streams(self):
"""ประมวลผล video streams จากกล้อง"""

# รับ video frames จากกล้อง
media_list = self.inputs.video_in.get()

for media in media_list:
# ดึง frame จาก video stream
frame = media.image # numpy array (H, W, 3)

# Preprocess frame
resized = cv2.resize(frame, (224, 224))
normalized = resized / 255.0
input_tensor = np.expand_dims(normalized, axis=0).astype(np.float32)

# Run inference
self.model.batch_size = 1
self.model.inputs.data.set(input_tensor)
self.model.call()

# รับผลลัพธ์
detections = self.model.outputs.detections.get()[0]

# วิเคราะห์ผลลัพธ์
defects = self.analyze_detections(detections, frame)

if defects:
self.handle_defect(defects, frame)

# ส่ง output กลับไป display
self.outputs.video_out.put(media_list)

def analyze_detections(self, detections, frame):
"""วิเคราะห์ผลลัพธ์จาก model"""
defects = []
for detection in detections:
class_id = int(detection[0])
confidence = detection[1]

if class_id == 1 and confidence > 0.85: # class 1 = defect
x1, y1, x2, y2 = detection[2:6]
defects.append({
'class': 'defect',
'confidence': float(confidence),
'bbox': [float(x1), float(y1), float(x2), float(y2)]
})
return defects

def handle_defect(self, defects, frame):
"""จัดการเมื่อพบข้อบกพร่อง"""
self.defect_count += 1

# บันทึก frame ที่มีข้อบกพร่องลง S3
_, buffer = cv2.imencode('.jpg', frame)

self.s3_client.put_object(
Bucket='quality-inspection-results',
Key=f'defects/defect_{self.defect_count}.jpg',
Body=buffer.tobytes()
)

# ส่ง metadata ไปยัง IoT Core
print(f"DEFECT DETECTED: {json.dumps(defects)}")

Package และ Deploy Application

# สร้าง application package
panorama-cli package-application

# Upload package ไปยัง S3
panorama-cli upload-package --package-name my_model --package-version 1.0

# Deploy ไปยัง appliance ผ่าน AWS CLI
aws panorama create-application-instance \
--name quality-inspection \
--manifest-payload '{"PayloadData": "..."}' \
--default-runtime-context-device device-id-123 \
--runtime-role-arn arn:aws:iam::123456789:role/PanoramaRole

รับ Output ผ่าน IoT Core

import boto3
import json

iot = boto3.client('iot-data', region_name='ap-southeast-1')

# Subscribe หรือ query ผลลัพธ์ที่ส่งจาก Panorama app
def get_latest_detection_results(device_id):
response = iot.get_thing_shadow(
thingName=f'panorama-{device_id}'
)
shadow = json.loads(response['payload'].read())
return shadow.get('state', {}).get('reported', {})

# ดึงสถิติการตรวจสอบคุณภาพ
results = get_latest_detection_results('my-appliance-id')
print(f"Total items inspected: {results.get('total_count', 0)}")
print(f"Defects found: {results.get('defect_count', 0)}")
defect_rate = results.get('defect_count', 0) / max(results.get('total_count', 1), 1)
print(f"Defect rate: {defect_rate:.2%}")

ราคา (ประมาณการในบาท)

รายการราคา USDราคา THB (1 USD = 35 บาท)
Panorama Appliance (hardware, ซื้อครั้งเดียว)~$7,000~245,000 บาท
Software subscription$8.33/device/เดือน~291 บาท/device/เดือน
Inference computeไม่คิดค่าเพิ่ม (compute อยู่บน device)ฟรี
S3 storage สำหรับ resultsตาม S3 standard rates~0.83 บาท/GB/เดือน
Partner devices (ราคาแตกต่างกัน)$500-3,000~17,500-105,000 บาท

ตัวอย่างค่าใช้จ่าย: โรงงานที่ใช้ Panorama Appliance 1 เครื่อง เชื่อมต่อกล้อง 8 ตัว

  • Hardware: $7,000 (~245,000 บาท ครั้งเดียว)
  • Monthly: $8.33 (~291 บาท/เดือน)
  • ค่า inference บน device ไม่เสียค่าใช้จ่าย แต่ประหยัดค่า cloud compute ได้มาก

เหมาะสำหรับ

  • โรงงานอุตสาหกรรมที่ต้องการ automated quality inspection บนสายการผลิต
  • คลังสินค้าที่ต้องการนับสินค้า, ตรวจสอบตำแหน่ง หรือ safety compliance
  • ร้านค้าปลีกที่ต้องการวิเคราะห์ foot traffic, shelf monitoring และพฤติกรรมลูกค้า
  • สถานที่ที่มีข้อจำกัดด้าน bandwidth ไม่สามารถส่งวิดีโอขึ้น cloud ได้
  • สภาพแวดล้อมที่ต้องการ real-time response ต่ำกว่า 100ms
  • องค์กรที่มีข้อกำหนดด้าน data privacy ไม่สามารถส่งภาพขึ้น cloud ได้

ใช้ร่วมกับ AWS Services

  • Amazon SageMaker - train และ package CV models สำหรับ deploy บน Panorama
  • Amazon S3 - เก็บ model artifacts, captured images และ inference results
  • AWS IoT Core - รับ events และ telemetry จาก Panorama applications
  • AWS Lambda - trigger downstream actions เมื่อ detect events
  • Amazon SNS - ส่ง real-time alerts ไปยัง operators
  • Amazon Kinesis Video Streams - backup video streams ไปยัง cloud
  • Amazon Rekognition - ใช้ pre-trained models สำหรับ common CV tasks
  • AWS Greengrass - extend edge computing capabilities

Use Case ตัวอย่าง

1. โรงงานผลิตชิ้นส่วนอิเล็กทรอนิกส์ตรวจสอบคุณภาพ

โรงงาน PCB assembly ในนิคมอุตสาหกรรมนวนครติดตั้ง Panorama Appliance เชื่อมต่อกับกล้อง high-resolution 6 ตัวบนสายการผลิต ระบบตรวจจับ solder defects, missing components และ component misplacement แบบ real-time ด้วย accuracy 99.5% ที่ความเร็ว 60 boards/นาที ลด false rejection rate จาก 3% เป็น 0.3% และลดต้นทุน rework ได้กว่า 5 ล้านบาทต่อปี

2. ห้างสรรพสินค้าวิเคราะห์ Shelf Availability

เครือห้างสรรพสินค้าใช้ AWS Panorama บน Panorama-enabled cameras ในทุกแผนก วิเคราะห์ shelf availability แบบ real-time ตรวจจับเมื่อสินค้าใกล้หมด shelf และส่ง alert ให้พนักงาน ระบบยังวิเคราะห์ planogram compliance เพื่อให้แน่ใจว่าสินค้าวางถูกตำแหน่งตาม merchandising plan ลดสถานการณ์ out-of-stock ได้ 40% และเพิ่ม sales ในพื้นที่ที่จัดการด้วยระบบนี้ขึ้น 15%

3. Construction Site ตรวจสอบ Safety Compliance

บริษัทรับเหมาก่อสร้างติดตั้ง Panorama Appliance บนไซต์งาน เชื่อมต่อกับกล้อง CCTV ที่มีอยู่ 12 ตัว ระบบตรวจจับแบบ real-time เมื่อ workers ไม่สวม hard hat, safety vest หรือ harness ในพื้นที่ที่กำหนด ส่ง alert ให้ safety officer ทันที ลด safety violations ได้ 75% ภายใน 3 เดือนแรก และไม่มีอุบัติเหตุร้ายแรงในปีแรกที่ใช้ระบบ