26 lines
732 B
Python
26 lines
732 B
Python
import sys
|
|
import json
|
|
import argparse
|
|
import os
|
|
|
|
# Add the current directory to sys.path so config and detector can be imported
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
from detector import FrameDetector
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('--input', required=True, help='Input image path')
|
|
parser.add_argument('--output', required=True, help='Output image path')
|
|
args = parser.parse_args()
|
|
|
|
detector = FrameDetector()
|
|
try:
|
|
result = detector.process_image(args.input, args.output)
|
|
print(json.dumps(result))
|
|
except Exception as e:
|
|
print(json.dumps({'success': False, 'error': str(e)}))
|
|
|
|
if __name__ == '__main__':
|
|
main()
|