Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP connnect can not connected, unity is runing #7

Open
lucasjinreal opened this issue Mar 13, 2022 · 9 comments
Open

TCP connnect can not connected, unity is runing #7

lucasjinreal opened this issue Mar 13, 2022 · 9 comments

Comments

@lucasjinreal
Copy link

INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Traceback (most recent call last):
File ".\main.py", line 239, in
main()
File ".\main.py", line 92, in main
socket = init_TCP()
File ".\main.py", line 37, in init_TCP
s.connect(address)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
[ WARN:0@4.732] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (539) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback

image

@mmmmmm44
Copy link
Owner

Is the TCP port in the unity program and the python program the same?

Also, ensure that the TCP connection function is being called when running the program.

Also, ensure that you run the unity program first before running the python program.

I think mainly these are the reasons that caused the error.

@Bruce-yu199
Copy link

Bruce-yu199 commented Mar 14, 2022

I had the same problem with you,and I solved it.
I only modified the ip address in the main.py file at first, and then the same situation as you occurred. Later, I found that there is also an ip address in the HiyoriController.cs file. The result is that I changed the ip address in the HiyoriController.cs file. After successfully running! As shown in the picture, I hope this will help you!

@lucasjinreal
Copy link
Author

@mmmmmm44 I am using the default port without changing, it should be same.

@lucasjinreal
Copy link
Author

@Bruce-yu199 I don't understand, doesn't they all using 127.0.01? it was local TCP IP

@Bruce-yu199
Copy link

@jinfagang no, I mean every computer's local TCP IP may be different. you should find your own ip and modify the ip in both .py and .cs file with your own ip. for example, i modify the ip with my computer's ip"192.168.xxx.xxx"

@lucasjinreal
Copy link
Author

@Bruce-yu199 I can 1000% sure that your problem wasn't solved by changing IP address.... 127.0.0.1 is just your local IP, it was same thing...

@Bruce-yu199
Copy link

@jinfagang sorry, I just reacted suddenly ,you are right. But I truly solve it by changing the ip with "192.168.xxx", maybe you can have a try or see if the port is occupied by another application ...

@lucasjinreal
Copy link
Author

@Bruce-yu199 I fonud it was due to c# scripts acutally not fully up:

imag

@mmmmmm44 Can u give me a hand? I droped the cs to unitychan obejct already..
and it can be seen here:

image

why give me this error?

@mmmmmm44
Copy link
Owner

Late reply, but I think you may have already figured it out.

The usage of UI stuff (the Canvas and remaining stuff) is only available and can be figured them out only when you import the sample package downloaded from the dropbox.

There is an App Controller object holding the UI System.cs, which controls the max/min value of the detection from Python and clip them.

There is also an Cavas object which holds the UI stuff (the buttons and sliders).

I don't include them in the tutorial videos as they are unfinished stuff to me (although they work), and also they are developed after I make the complete series.

Anyway, thank you for using my project. Hope you are having fun. ><

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants