Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/tensorflow/compositing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import cv2
import numpy as np
import tflite_runtime.interpreter as tflite
from ai_edge_litert.interpreter import Interpreter
from PIL import Image

from picamera2 import MappedArray, Picamera2, Preview
Expand Down Expand Up @@ -52,7 +52,7 @@ def InferenceTensorFlow(image, model, label=None):
else:
labels = None

interpreter = tflite.Interpreter(model_path=model, num_threads=4)
interpreter = Interpreter(model_path=model, num_threads=4)
interpreter.allocate_tensors()

input_details = interpreter.get_input_details()
Expand Down
11 changes: 4 additions & 7 deletions examples/tensorflow/real_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
# Install necessary dependences before starting,
#
# $ sudo apt update
# $ sudo apt install build-essential
# $ sudo apt install libatlas-base-dev
# $ sudo apt install python3-pip
# $ pip3 install tflite-runtime
# $ pip3 install opencv-python==4.4.0.46
# $ sudo apt install python3-opencv
# $ pip3 install ai-edge-litert
# $ pip3 install pillow
# $ pip3 install numpy
#
# and run from the command line,
#
Expand All @@ -25,7 +22,7 @@

import cv2
import numpy as np
import tflite_runtime.interpreter as tflite
from ai_edge_litert.interpreter import Interpreter

from picamera2 import MappedArray, Picamera2, Preview

Expand Down Expand Up @@ -61,7 +58,7 @@ def InferenceTensorFlow(image, model, output, label=None):
else:
labels = None

interpreter = tflite.Interpreter(model_path=model, num_threads=4)
interpreter = Interpreter(model_path=model, num_threads=4)
interpreter.allocate_tensors()

input_details = interpreter.get_input_details()
Expand Down
11 changes: 4 additions & 7 deletions examples/tensorflow/real_time_with_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
# Install necessary dependences before starting,
#
# $ sudo apt update
# $ sudo apt install build-essential
# $ sudo apt install libatlas-base-dev
# $ sudo apt install python3-pip
# $ pip3 install tflite-runtime
# $ pip3 install opencv-python==4.4.0.46
# $ sudo apt install python3-opencv
# $ pip3 install ai-edge-litert
# $ pip3 install pillow
# $ pip3 install numpy
#
# and run from the command line,
#
Expand All @@ -25,7 +22,7 @@

import cv2
import numpy as np
import tflite_runtime.interpreter as tflite
from ai_edge_litert.interpreter import Interpreter

from picamera2 import MappedArray, Picamera2, Preview

Expand Down Expand Up @@ -67,7 +64,7 @@ def InferenceTensorFlow(image, model, output, label=None):
else:
labels = None

interpreter = tflite.Interpreter(model_path=model, num_threads=4)
interpreter = Interpreter(model_path=model, num_threads=4)
interpreter.allocate_tensors()

input_details = interpreter.get_input_details()
Expand Down
4 changes: 2 additions & 2 deletions examples/tensorflow/remove_background.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import cv2
import numpy as np
import tflite_runtime.interpreter as tflite
from ai_edge_litert.interpreter import Interpreter
from PIL import Image

from picamera2 import Picamera2, Preview
Expand All @@ -21,7 +21,7 @@
def InferenceTensorFlow(image, model):
global background_mask

interpreter = tflite.Interpreter(model_path=model, num_threads=4)
interpreter = Interpreter(model_path=model, num_threads=4)
interpreter.allocate_tensors()

input_details = interpreter.get_input_details()
Expand Down
4 changes: 2 additions & 2 deletions examples/tensorflow/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import cv2
import numpy as np
import tflite_runtime.interpreter as tflite
from ai_edge_litert.interpreter import Interpreter
from PIL import Image

from picamera2 import Picamera2, Preview
Expand Down Expand Up @@ -40,7 +40,7 @@ def InferenceTensorFlow(image, model, colours, label=None):
else:
labels = None

interpreter = tflite.Interpreter(model_path=model, num_threads=4)
interpreter = Interpreter(model_path=model, num_threads=4)
interpreter.allocate_tensors()

input_details = interpreter.get_input_details()
Expand Down
6 changes: 3 additions & 3 deletions examples/tensorflow/yolo_v5_real_time_with_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Use system python or if you prefer not to mess with system python:
# install a version manager (like pyenv) and use 'pyenv virtualenv --system-site-packages ENV_NAME'
# $ pip3 install tflite-runtime
# $ pip3 install ai-edge-litert
# $ pip3 install opencv-python-headless (if using system python: sudo apt install python3-opencv)
#
# and run from the command line,
Expand All @@ -26,7 +26,7 @@

import cv2
import numpy as np
import tflite_runtime.interpreter as tflite
from ai_edge_litert.interpreter import Interpreter

from picamera2 import MappedArray, Picamera2, Platform, Preview

Expand Down Expand Up @@ -103,7 +103,7 @@ def main():
picam2.post_callback = DrawRectangles

picam2.start()
interpreter = tflite.Interpreter(model_path=args.model, num_threads=4)
interpreter = Interpreter(model_path=args.model, num_threads=4)
interpreter.allocate_tensors()

while True:
Expand Down