Skip to content

Instantly share code, notes, and snippets.

@mgyong
mgyong / gist:408ec07308a7fee2b34cbf0bf4bb3ce1
Created June 25, 2023 00:07
python script for imagine mobile translation using google cloud translation
import re
def translate_text(target: str, text: str) -> dict:
"""Translates text into the target language.
Target must be an ISO 639-1 language code.
See https://g.co/cloud/translate/v2/translate-reference#supported_languages
"""
from google.cloud import translate_v2 as translate
pragma solidity >=0.7.0;
contract MySmartContract {
function Hello() public view returns (string memory) {
return "Hello World";
}
function Greet(string memory str) public view returns (string memory) {
return str;
}
}
pragma solidity >0.7;
contract Inbox {
string value;
function get() public view returns (string memory) {
return value;
}
package main
import (
"fmt"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/mgyong/creatornfts/backend/pkg/eth/contract/api"
)
@mgyong
mgyong / hand_landmark_gpu.pbtxt
Created November 1, 2019 23:54
MediaPipe issue https://github.com/google/mediapipe/issues/202 location of file /mediapipe/mediapipe/graphs/hand_tracking/subgraphs/hand_landmark_gpu.pbtxt
# MediaPipe hand landmark localization subgraph.
type: "HandLandmarkSubgraph"
input_stream: "IMAGE:input_video"
input_stream: "NORM_RECT:hand_rect"
output_stream: "LANDMARKS:hand_landmarks"
output_stream: "NORM_RECT:hand_rect_for_next_frame"
output_stream: "PRESENCE:hand_presence"
@mgyong
mgyong / BUILD
Created October 26, 2019 15:53
BUILD file at mediapipe/mediapipe/examples/desktop/BUILD for https://gist.github.com/mgyong/7353474eb3e57ba95621632af274911a
# Copyright 2019 The MediaPipe Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@mgyong
mgyong / demo_run_graph_main_out.cc
Created October 26, 2019 15:50
Example of reading out Detection proto for MediaPipe Object Detection example
// Copyright 2019 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,