|
@@ -6,6 +6,7 @@ import queue
|
|
|
import argparse
|
|
|
import tempfile
|
|
|
import threading
|
|
|
+import subprocess
|
|
|
from itertools import groupby
|
|
|
|
|
|
import cv2
|
|
@@ -72,9 +73,12 @@ def chunks(lst, n):
|
|
|
def run_check(cmd):
|
|
|
logger.info(f"Executing '{cmd}'.")
|
|
|
|
|
|
- if os.system(cmd) != 0:
|
|
|
- raise ValueError("Exit code != 0.")
|
|
|
-
|
|
|
+ subprocess.check_output(
|
|
|
+ cmd,
|
|
|
+ stdout=subprocess.STDOUT,
|
|
|
+ stderr=subprocess.STDOUT,
|
|
|
+ timeout=100
|
|
|
+ )
|
|
|
|
|
|
def extract_image(path):
|
|
|
logger.info(f"Extract image '{path}'.")
|