GCF | Deep Model for Multi-Focus Image Fusion | 3D Printing library
kandi X-RAY | GCF Summary
kandi X-RAY | GCF Summary
This is the code of the following paper for multi-focus image fusion:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Train the model
- Connects connected regions
- Decode the given image
- Calculate the maximum neighbor
- 2d convolution layer
- Encodes the given image
- Transform two images
- Gradient of the image
- Binary function
- Computes the SSIM loss between two images
- Compute the Gaussian gaussian
- Transform a tensor
- Process input tensor
- Generate image
- Filtering filter
GCF Key Features
GCF Examples and Code Snippets
Community Discussions
Trending Discussions on GCF
QUESTION
There are a couple of notable packages on pub.dev that offer video compression. I've tried them, and other sketchy packages, and none work well once a video gets around 300MB. They crash or have other issues on various platforms and hardware. Namely, video compress and light compressor. The GH commits and support are concerning as well on the packages I've seen for video compression in pub.dev. PR's not being pulled in and issues not being resolved in a timely manner and some quite serious for recent android APK updates. So not something I want in my dependency stack.
I am uploading to Google Cloud Storage using FlutterFire. While my code does upload using FireBaseStorage upload task it does not have any ability to compress on the client side or handle background uploading when the app is closed.
So, currently on the server side, I have a GCF that triggers on file uploaded. Then I use nodejs ffmpeg, which is baked into GCF's to compress server side and convert to H264. And finally delete the original large upload video and save the compressed video to storage.
This solution works, but depending on a user's connection and whether they are on wifi, can take an awful long time and when it fails or the user closes the app, my current solution is useless.
I wish there was a solid native library on Android and iOS, that I could tap into, to confidently perform compression and conversion from any format to H264 and also allow uploading, whether my app is closed or in the background, to GC storage. Any thoughts? I wish this was standard in FlutterFire's cloud storage handling!
I have yet to test flutter_ffmpeg, but only because some have said it runs so slowly on client. So again, Flutter/Dart can access natively written code, but I don't know where to start on Android/iOS to do this the right way. And I understand this is what some of the packages are doing, but they do not work with large videos, so I'm hoping someone can point me in the right direction on Android and iOS.
My code for handling upload tasks to GC storage.
...ANSWER
Answered 2022-Feb-20 at 03:41I did resolve, to some degree, my original post's questions and frustrations by using the ffmpeg_kit_flutter_full_gpl package on the client side, and then ffmpeg again in GCF on the server side. In summary:
- Within 60 seconds, I can now compress a 2 minute video by 90% before uploading to firebase storage.
- Using
onFinalize
via GCF on the server side I run ffmpeg again on the uploaded video and gain another 77% reduction in file size on the server side without any loss in video quality. - My solution does not yet upload while the app is closed.
- On the client side, this solution requires setting the camera
ResolutionPreset
tohigh
(720p), rather thanmax
, which can be a minimum of 1080p, and setting the ffmpeg-preset veryfast
rather than themedium
default.
Camera & ffmpeg solution settings:
- Flutter camera package
ResolutionPreset
tohigh
- ffmpeg
-preset veryfast
Transcoding results stats for 2 minute video:
- Before transcode: 255MB
- After client side transcode: 25MB (90% decrease in size before upload)
- Time to transcode: 60 seconds
onFinalized
GCF ffmpeg transcode: 19MB (77% reduction in size)- In total a 93% reduction in size while keep high quality 720p video.
flutter_ffmpeg is archived, the new ffmpeg flutter package is ffmpeg_kit_flutter.
That being said, I used ffmpeg_kit_flutter to build my solution on the client side, rather than the server side, and transcode the video before uploading.
Cons:
- Doubled my app size to use ffmpeg, because I needed access to both
lame
andx264
so I had to install the full-gpl package to gain access to these libraries. - A two minute video can take up to 60 seconds to transcode.
The pros:
- Low bandwidth connections will operate much better after a video is reduced in size by 90%.
- Large videos will transcode and ffmpegkit does not crash like other flutter packages I've tried.
- The second pass with ffmpeg on GCF gains another 77% reduction in size taking a video of 100's of MB's down to just 10-20 MB max for eventually delivery.
- Costs lower on the front and back end.
So, you'll have to decide if the pros outweighs the cons and if 720p is high enough quality for playback. For me 720p looks perfect for video playback on a mobile phone and 1080p or higher was big time overkill.
I've provided sample code (not full classes) to give anyone looking to implement my solution a try. It became very important, due to the amount of time to transcode, to display a progress meter so the user does not give up on the process. You'll see my simple solution to displaying transcoding progress.
pubspec.yaml
- camera package for video recording
- riverpod required for statenotifier and transcode/upload progress notifications
- ffmpeg_kit_flutter_full_gpl (the full_gpl gets the ffmpeg package with most libraries) required to get
h264
andlibmp3lame
encoders to produce most widely playable transcoded videos. - wakelock required because transcoding takes so long you don't want the phone to sleep while transcoding.
QUESTION
I'm trying to create a Firebase Function but I'm running into a deploy error, even when deploying the default helloworld
function.
The firebase-debug.log file mentions this:
Could not find image for function projects/picci-e030e/locations/us-central1/functions/helloWorld.
I have been trying to debug and so far have not been able to solve it...
firebase-debug.log
...ANSWER
Answered 2022-Feb-06 at 14:36Could not find image for function projects/picci-e030e/locations/us-central1/functions/helloWorld.
The Firebase Function deployment failed because it cannot find the image built based on your function app. There might be a problem building in your app, it could be your dependencies or files.
I replicated your issue, received the same error and solved it. There's a problem with the package.json
file and package-lock.json
. If you just add(without installing) your dependency in package.json
you should delete or remove your package-lock.json
that will be found in function directory before you deploy it again using the deployment command:
QUESTION
I am trying to get a Cloud Function to create a Cloud Task that will invoke a Cloud Function. Easy.
The flow and use case are very close to the official tutorial here.
I also looked at this article by Doug Stevenson and in particular its security section.
No luck, I am consistently getting a 16 (UNAUTHENTICATED)
error in Cloud Task.
If I can trust what I see in the console it seems that Cloud Task is not attaching the OIDC token to the request:
Yet, in my code I do have the oidcToken
object:
ANSWER
Answered 2022-Feb-16 at 22:24Your audience is incorrect. It must end by the function name. Here, you only have the region and the project https://-.cloudfunction.net/
. Use the full Cloud Functions URL.
QUESTION
I'm unable to create a Cloud Function in my GCP project using GUI, but have admin roles for GCF, SA and IAM.
Here is the error message:
Missing necessary permission iam.serviceAccounts.actAs for cloud-client-api-gae on the service account serviceaccountname@DOMAIN.iam.gserviceaccount.com. Grant the role 'roles/iam.serviceAccountUser' to cloud-client-api-gae on the service account serviceaccountname@DOMAIN.iam.gserviceaccount.com.
cloud-client-api-gae
is not an SA nor User on my IAM list. It must be a creature living underneath Graphical User Interfrace.
I have Enabled API for GCF, AppEngine and I have Service Account Admin
role.
I had literally 0 search results when googling for cloud-client-api-gae
.
ANSWER
Answered 2022-Jan-18 at 13:53I contacted GCP support and it seems I was missing a single permission for my user:
Service Account User
- that's it.
PS: Person from support didn't know what this thing called "cloud-client-api-gae" is.
QUESTION
I've deployed hundreds of function and this is the first time I encounter this issue. Simply, it stops deploying function process, saying:
Unhandled error cleaning up build images. This could result in a small monthly bill if not corrected. You can attempt to delete these images by redeploying or you can delete them manually at https://console.cloud.google.com/gcr/images/[project-name]/us/gcf
The way I deploy is through Firebase CLI command: firebase deploy --only functions:nameOfFunction
Question is what are those images I have to delete? Why? How can I solve it?
...ANSWER
Answered 2021-Aug-01 at 15:56Cloud Functions uses another product called Cloud Build to build the server images that actually get deployed. Those images are stored in Cloud Storage, and that storage is billed to your account.
Read more about it:
- https://github.com/firebase/firebase-tools/issues/3404
- https://krasimirtsonev.com/blog/article/firebase-gcp-saving-money
Watch:
You should be able to locate and delete the files manually in the Google Cloud console. But it sounds like there is a bug here with the files not being cleaned up automatically, so you contact Firebase support directly.
QUESTION
For some reason, I can no longer deploy existing google functions from my local machine or from github actions. Whenever I deploy using the gcloud functions deploy
command, I get the following error in the console: ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: Unknown Syntax Error: Invalid option name ("--production=false").
I am not using a --production=false option in my gcloud deploy command, so I don't really understand where that is coming from.
Build logs always failing on:
Step #1 - "build": Unable to delete previous cache image: DELETE https://us.gcr.io/v2/{{projectId}}/gcf/{{region}}/{{guid}}/cache/manifests/sha256:{{imageId}}: GOOGLE_MANIFEST_DANGLING_TAG: Manifest is still referenced by tag: latest
.
Deploy command:
ANSWER
Answered 2022-Feb-08 at 17:52This was due to a regression issue on Google's part. They released a fix for it today and deploys are working again now.
Issue: https://github.com/GoogleCloudPlatform/buildpacks/issues/175#issuecomment-1030519240
QUESTION
I am trying to invoke Airflow 2.0's Stable REST API from Cloud Composer Version 1 via a Python script and encountered a HTTP 401 error while referring to Triggering DAGS with Cloud Functions and Access the Airflow REST API.
The service account has the following list of permissions:
roles/iam.serviceAccountUser
(Service Account User)roles/composer.user
(Composer User)roles/iap.httpsResourceAccessor
(IAP-Secured Web App User, added when the application returned a 403, which was unusual as the guides did not specify the need for such a permission)
I am not sure what is wrong with my configuration; I have tried giving the service account the Editor role and roles/iap.tunnelResourceAccessor
(IAP-Secured Tunnel User) & roles/composer.admin
(Composer Administrator), but to no avail.
EDIT: I found the source of my problems: The Airflow Database did not have the credentials of the service account in the users table. However, this is unusual as I currently have a service account (the first I created) whose details were added automatically to the table. Subsequent service accounts were not added to the users table when they tried to initially access the REST API, thus returning the 401. I am not sure of a way to create users without passwords since the Airflow web server is protected by IAP.
...ANSWER
Answered 2021-Oct-29 at 10:32ewertonvsilva's solution worked for me (manually adding the service account to Airflow using gcloud composer environments run --location= users -- create ...
)
At first it didn't work but changing the username to accounts.google.com:
made it work.
Sorry for not commenting, not enough reputation.
QUESTION
I feel like I've tried everything I've been able to find here, google, matplotlib documentation, and a couple of other forums. I can't get xticks to show on the upper subplot/graph, and the lower. I read in a forum related to matplotlib that others had the same problem as I, with earlier versions of matplotlib, but the thread died a couple of years ago, and the fixes that was suggested to work, didn't in my case.
The data is pulled from CSV files, and converted to floats, and datetime values
...ANSWER
Answered 2021-Aug-16 at 12:35As already pointed out by JohanC, you should use the matplotlib's object-oriented interface.
You can create the two subplots you need and then customize the axis based on your needs:
QUESTION
I need to plot an array. I tried the code from Joe Kington (Show the values in the grid using matplotlib), but I get the error:
...ANSWER
Answered 2021-Oct-25 at 06:49Try something like this:
QUESTION
I'm trying to trigger Airflow DAG inside of a composer environment with cloud functions. In order to do that I need to get the client id as described here. I've tried with curl command but it doesn't return any value. With a python script I keep getting this error:
...ANSWER
Answered 2021-Sep-28 at 13:00Posting this Community Wiki
for better visibility
.
As mentioned in the comment section by @LEC
this configuration is compatible with Cloud Composer V1
which can be found in GCP Documentation Triggering DAGs with Cloud Functions.
At the moment there can be found two tabs Cloud Composer 1 Guides
and Cloud Composer 2 Guides
.
Under Cloud Composer 1
is code used by the OP, but if you will check Cloud Composer 2
under Manage DAGs
> Triggering DAGs with Cloud Functions you will get information that there is not proper documentation yet.
This documentation page for Cloud Composer 2 is not yet available. Please use the page for Cloud Composer 1.
As solution, please use Cloud Composer V1
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install GCF
You can use GCF like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page