Skip to content

Instantly share code, notes, and snippets.

View Hrushi20's full-sized avatar
🕛
Bored

Hrushikesh Hrushi20

🕛
Bored
View GitHub Profile
@Hrushi20
Hrushi20 / memory.rs
Last active January 31, 2023 18:22
Writing data to webassembly memory
WasmEdge
===============================================================================================================================
use wasmedge_sdk::*;
use anyhow::{Result, Error, anyhow};
use wasmedge_sdk::WasmValue;
use crate::SmartEngine;
@Hrushi20
Hrushi20 / instance.rs
Last active January 31, 2023 05:42
The Memory from wasmedge-sdk doesn't support the copy/clone trait. I'm not able to fetch the value inside a MutexLock as I am not able to clone it. The fluvio-smartengine crate use Mutex locks to write data to memory.
use std::any::Any;
use std::sync::{Arc, Mutex};
use std::fmt::{self, Debug};
use fluvio_protocol::{Encoder, Decoder};
use wasmedge_sdk::{ImportObject, ImportObjectBuilder, Func};
use wasmedge_sdk::{Module,Store,Instance,CallingFrame,WasmValue,error::HostFuncError};
use wasmedge_sys::{Memory};
use tracing::{debug};
@Hrushi20
Hrushi20 / blaze_face_detect.py
Created January 23, 2023 19:08 — forked from ogl4jo3/blaze_face_detect.py
Demo BlazeFace model.
import cv2
import time
import math
import numpy as np
import tensorflow as tf
class SsdAnchorsCalculatorOptions:
def __init__(self, input_size_width, input_size_height, min_scale, max_scale
, num_layers, feature_map_width, feature_map_height
, strides, aspect_ratios, anchor_offset_x=0.5, anchor_offset_y=0.5