我使用Tensorflow作为Keras的后端,我正在尝试了解如何引入我的标签进行图像分割训练.
我正在使用LFW零件数据集,它具有地面实况图像和地面实况掩模,看起来像这样的*1500训练图像:
据我了解这个过程,在训练期间,我加载了两个
分批执行此操作以满足我的需求.现在我的问题是,将它们(图像和蒙版图像)加载为NumPy数组(N,N,3)是否足够,或者我是否需要以某种方式处理/重塑Mask图像.实际上,掩码/标签表示为[R,G,B]像素,其中:
我可以做这样的事情将它标准化为0-1,我不知道我是否应该:
im = Image.open(path)
label = np.array(im, dtype=np.uint8)
label = np.multiply(label, 1.0/255)
Run Code Online (Sandbox Code Playgroud)
所以我最终得到:
我在网上找到的所有内容都使用tensorflow或keras中的现有数据集.如果您拥有可以被认为是自定义数据集的东西,那么如何解决问题就没有什么是真正明确的.
我发现这与Caffe有关:https://groups.google.com/forum/#! topic/ caffe-users/ 9qNggEa8EaQ
他们主张将蒙版图像转换为(H, W, 1)(HWC)?其中我的类分别0, 1 ,2用于Background,Hair和Face.
这可能是重复的(类似问题/答案的组合):
我找到了一个将PascalVOC处理成(N,N,1)的例子,我改编了:
LFW_PARTS_PALETTE = {
(0, 0, 255) : 0 , # background (blue)
(255, 0, 0) : 1 , # hair (red)
(0, 0, 255) : 2 , # face (green)
}
def …Run Code Online (Sandbox Code Playgroud) 我正在测试使用 Azure 通知中心在我的 iOS 设备上注册推送通知。
按照这里的教程:https : //docs.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-ios-push-notification-apns-get-started
调用时出现运行时异常 Hub.RegisterNativeAsync(deviceToken, tags, (errorCallback) => {
具体的例外是:
ObjCRuntime.RuntimeException
当动态注册器已被链接掉时,不支持 BlockLiteral.SetupBlock。
堆栈跟踪:
at ObjCRuntime.BlockLiteral.SetupBlock (System.Delegate trampoline, System.Delegate userDelegate, System.Boolean safe) [0x00002] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/ObjCRuntime/Blocks.cs:94
at ObjCRuntime.BlockLiteral.SetupBlock (System.Delegate trampoline, System.Delegate userDelegate) [0x001ef] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/ObjCRuntime/Blocks.cs:205
at WindowsAzure.Messaging.SBNotificationHub.RegisterNativeAsync (Foundation.NSData deviceToken, Foundation.NSSet tags, WindowsAzure.Messaging.ErrorCallback errorCallback) [0x0002d] in <c5112db82ee94ad88e9a597b356dac0c>:0
at MyApp.Test.Azure.AzureNotificationHubService.OnRegisteredForRemoteNotifications (Foundation.NSData deviceToken) [0x00019] in /Users/aventurella/github/my-test-app/MyApp.Test.Azure/Services/AzureNotificationHubService.cs:47
at MyApp.Test.Azure.AppDelegate.RegisteredForRemoteNotifications (UIKit.UIApplication application, Foundation.NSData deviceToken) [0x00001] in /Users/aventurella/github/my-test-app/MyApp.Test.Azure/AppDelegate.cs:47
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] …Run Code Online (Sandbox Code Playgroud) 在我的 Cognito 测试中,我遇到了一个问题。如果用户注册,但放弃确认步骤,然后稍后返回完成确认,则该用户似乎无法继续确认过程。
我可以看到我在用户池中创建的用户,但是当我登录时UserNotFoundException(用户不存在)引发异常。
我在这里发现了一个与 JS API 相关的问题(https://github.com/aws/amazon-cognito-identity-js/issues/514#issuecomment-365470081):
用户以未确认状态在 Cognito 中创建。现在我尝试使用相同的电子邮件登录,但我总是收到 UserNotFoundException。根据文档的预期结果应该是 UserNotConfirmedException 以便我可以要求用户确认帐户。
我正在使用最新的 Js SDK
看起来这也会影响 C# SDK。C# SDK 确实拥有这个异常类:Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException它似乎没有被引发。
是否需要配置任何特殊内容才能在登录时引发此异常?
我正在使用以下内容在 C# SDK 中发送我的请求
AuthFlowResponse response = null;
try
{
response = await user.StartWithSrpAuthAsync(
srpRequest: new InitiateSrpAuthRequest
{
Password = password
});
}
catch(Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException e)
{
// never catches here
}
catch(Amazon.CognitoIdentityProvider.Model.UserNotFoundException e)
{
// catches here
}
Run Code Online (Sandbox Code Playgroud)
我还在这里打开了一个相关的 Github 问题:
我正在测试将我的Django应用程序部署到AWS的Fargate服务中.
一切似乎都在运行,但我收到了Health Check错误,因为Application Load Balancer正在使用主机的Local Ip向我的Django应用程序发送请求.这在日志中给了我一个Allowed Host错误.
HTTP_HOST标头无效:'172.31.86.159:8000'.您可能需要将"172.31.86.159"添加到ALLOWED_HOSTS
我尝试在任务启动时获取Local ip并将其附加到我的ALLOWED_HOSTS,但是这在Fargate下失败了:
import requests
EC2_PRIVATE_IP = None
try:
EC2_PRIVATE_IP = requests.get('http://169.254.169.254/latest/meta-data/local-ipv4', timeout = 0.01).text
except requests.exceptions.RequestException:
pass
if EC2_PRIVATE_IP:
ALLOWED_HOSTS.append(EC2_PRIVATE_IP)
Run Code Online (Sandbox Code Playgroud)
有没有办法获得ENI IP地址,所以我可以将它附加到ALLOWED_HOSTS?
使用 Visual Studio Community for Mac 7.3.3 (build 7)我制作了一个 iOS 项目。然后创建一个新的 .NET Standard 2.0 库。
使用我添加的内置 NuGet 支持 Xamarin.Forms到每个项目中。
在 Net Standard 2.0 Lib I 中 Add -> New File选择Forms ContentPage Xaml
这将创建一个空类和相应的 XAML 文件。在类构造函数中,它包含 1 行:
InitializeComponent();
当我尝试编译 NET Standard 2.0 lib 或 iOS 项目时,编译失败并显示以下错误:
错误 CS0103:名称“InitializeComponent”在当前上下文中不存在 (CS0103)
我没有向任何一个项目添加其他代码或依赖项。显然,我错过了一些对我来说并不明显的东西。
在本地使用 Google Spanner 模拟器运行 (0.8.0)
export SPANNER_EMULATOR_HOST=localhost:9010
Executing: docker run -p 127.0.0.1:9010:9010 -p 127.0.0.1:9020:9020 gcr.io/cloud-spanner-emulator/emulator:0.8.0
[cloud-spanner-emulator] 2020/07/17 22:23:21 gateway.go:135: Cloud Spanner emulator running.
[cloud-spanner-emulator] 2020/07/17 22:23:21 gateway.go:136: REST server listening at 0.0.0.0:9020
[cloud-spanner-emulator] 2020/07/17 22:23:21 gateway.go:137: gRPC server listening at 0.0.0.0:9010
Run Code Online (Sandbox Code Playgroud)
这可以与Google JDBC Spanner 驱动程序一起使用吗?
在我的测试中,我的猜测是:
不,目前不支持此功能。
我可以设法连接到 Spanner 的 GCP 实例,但不能连接到模拟器。当我尝试使用端口 9010 或 9020 时,它基本上挂起。
我的jdbc连接字符串如下(项目、实例和数据库都已创建):
gcloud spanner databases list --project=local-project --instance=local-instance --configuration=spanner-emulator --format json
[
{
"name": "projects/local-project/instances/local-instance/databases/myDatabase",
"state": "READY"
}, …Run Code Online (Sandbox Code Playgroud) aws-cognito ×1
aws-fargate ×1
azure ×1
django ×1
keras ×1
tensorflow ×1
xamarin ×1
xamarin.ios ×1