-
Notifications
You must be signed in to change notification settings - Fork 30
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
Can you make a Windows tutorial? #6
Comments
Hi @forestcolat — I commented in #5 which I think will get you unstuck. Respond with any issues in that thread. I'll leave this issue open in case anyone from the community wants to post a step-by-step windows tutorial (I'm developing on linux and mac at the moment). |
Hey @forestcolat, not sure if you're still working on this, but for anyone else who's interested I got mediapipe working on Windows 10 after a couple days of messing around. Here's what I did: 1. Follow steps 1-8 of the official Windows installation guide You can find BAZEL_VC_FULL_VERSION by opening the VS Developer Command Prompt and running 2. Patch or rollback mediapipe/framework/deps/file_helpers.cc - line 19
mediapipe/framework/legacy_calculator_support.h - lines 69, 83
mediapipe/framework/packet.h - lines 442-444, 451
3. Run the Hello World example per step 9 If the build completes successfully and you see 4. Windows-ifying Madeline's class First, remove the unix headers from the top of the file and add the winsock headers. Your second set of includes should look like this #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
//Winsock Library
#include <winsock2.h>
#pragma comment(lib,"ws2_32.lib") Next, the // Initialize winsock
WSADATA socketsImplData;
if (int result = WSAStartup(MAKEWORD(2, 2), &socketsImplData) != 0) {
fprintf(stderr, "Failed to start winsock - Startup error code %d\n", result);
exit(EXIT_FAILURE);
} and change the socket creation call to specify that we want a UDP socket (IPPROTO_UDP) and to give us an error code if things go wrong // Creating socket (it's still basically a file descriptor)
if ( (sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) != 0 ) {
fprintf(stderr, "socket creation failed - error code %d\n", WSAGetLastError());
exit(EXIT_FAILURE);
} Last thing to change in the // Filling server information
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(PORT);
servaddr.sin_addr.s_addr = inet_addr("127.0.0.1") I'm not 100% sure on what you should put here if you want to send data to another device. I would have thought INADDR_ANY, but that gives me error 10049 - Cannot assign requested address. Any help appreciated. Finally, to properly shut down the socket we'll want to change the calculator's ::mediapipe::Status Close(CalculatorContext* cc) {
if (!cc->GraphStatus().ok()) {
return ::mediapipe::OkStatus();
}
closesocket(sock);
WSACleanup();
return ::mediapipe::OkStatus();
} Here's a gist with all those changes added in. Aaaaaaand we're done! From here you can follow all the steps in Madeline's tutorial and hopefully it'll work on your Windows machine. Let me know if anything blows up. I should mention that I actually ended up creating a slightly different calculator than MyPassThroughCalculator, and am just quickly applying what I learnt there to type up this example. I haven't fully tested it, so if there's anything I missed give me a yell. Happy to help anyone else. Thanks heaps @madelinegannon for the awesome tutorial! Wouldn't have gotten anywhere without it 😃 |
This is so great! Thanks for sharing @ChapC |
Hi @ChapC , I really appreciate you taking the time to walk people through your process. I am quite new to this type of install and was curious if you might help point me in the right direction with some of the steps. Thank you for your help with this! |
Glad to help! I'm not sure exactly what you mean by 'entering' the MediaPipe repository. In step 7, running the I used the normal command prompt too, so it should work okay. Let me know how you go with it. |
Thank you! This was already a huge help, I am working through the next steps now and will keep you posted. Also, thank you to @madelinegannon!! What a tremendous effort to get this information out there. |
I've trying for around 3 weeks, but "transfer" the tutorial from Xcode to Visual studio is a little more complex than a imagined. Is this even posible? or Am I doing something that is just avaluable for Mac?
The text was updated successfully, but these errors were encountered: