asus4 / tf-lite-unity-sample

TensorFlow Lite Samples on Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CameraTextureBackground doesn't support Built-in Render Pipeline

Pypow opened this issue · comments

Environment

  • OS: Windows 11
  • Unity Version: Unity 2021.3.19f1

Describe the bug
When I click on play in the SSD sample Unity Scene, I can see that my webcam is turning on, in the Unity game view I can see solid gray background and objects being detected (Green bounding box with label). I am not getting live camera feed from my webcam.
(I have tried to build it to Android device (Android:13, ARM64), but I experienced the same issue as above)

Steps to reproduce the behavior:

  1. Download this repo and make changes to manifest file as below, delete packages-lock.json.
  2. open SSD Sample Scene.
  3. Play the scene.

Expected behavior
The bounding box of detected objects should appear with the camera live feed as the background.

Screenshots
manifest_update
output

Additional context
Referred to similar issue: #250. Since my scene was getting updated I assumed unity version was not the problem.
Let me know if I have done anything wrong or if you need any additional information.
Great Repo! Thank you for your hard work.

I didn't reproduce this. Would you mind uploading a repro project to GitHub or somewhere?

Sure,
Project Repo: https://github.com/Pypow/TFLiteSetUp

When uploading the project to GitHub, I noticed I had a missing script on Main Camera, this may be the cause of my issue,
screenshot missing script

Although I am not able to figure out the name of the missing script, I believe it was due to a compile error related to some missing package?

Here is a screenshot of my Package Manager,
image

Thanks for your help!

@Pypow Thanks for sharing your project.

I figured out the issue. The CameraTextureBackground.cs supports only URP by adding CameraTextureBackgroundRendererFeature in the Renderer Feature config. And it didn't support the Built-in Render Pipeline. I'll add support for the Built-in Render Pipeline.

@Pypow, this issue should have been fixed in #317. Please check it out.