MetaForce/Forsage/魔豹聯盟馬蹄鏈佛薩奇2.0系統開發

caiayu1234發表於2023-04-06

互操作性意味著使用者能夠較輕鬆地實現在元宇宙的不同空間及平臺上進行無縫切換,這意味著不同平臺與環境的資訊、資源、合約能夠在更大程度上實現協同。


從如今的Web2.0過渡到Web3.0是實現互操作性的必由之路。現實中的商業組織、社群可以在虛擬空間內謀求無差異的執行體驗,使用者留存在基於Web3.0的不同商家和環境中的資料、數字資產也能隨時調動。I88智慧合約I928系統開發8024

  

  N,K,_,W=heatmaps.shape

  

  heatmaps_reshaped=heatmaps.reshape((N,K,-1))

  

  idx=np.argmax(heatmaps_reshaped,2).reshape((N,K,1))

  

  maxvals=np.amax(heatmaps_reshaped,2).reshape((N,K,1))

  

  preds=np.tile(idx,(1,1,2)).astype(np.float32)

  

  preds[:,:,0]=preds[:,:,0]%W

  

  preds[:,:,1]=preds[:,:,1]//W

  

  preds=np.where(np.tile(maxvals,(1,1,2))>0.0,preds,-1)

  

  return preds,maxvals

  

  def transform_preds(coords,center,scale,output_size,use_udp=False):

  

  """Get final keypoint predictions from heatmaps and apply scaling and

  

  translation to map them back to the image.

  

  Note:

  

  num_keypoints:K

  

  Args:

  

  coords(np.ndarray[K,ndims]):

  

  *If ndims=2,corrds are predicted keypoint location.

  

  *If ndims=4,corrds are composed of(x,y,scores,tags)

  

  *If ndims=5,corrds are composed of(x,y,scores,tags,

  

  flipped_tags)

  

  center(np.ndarray[2,]):Center of the bounding box(x,y).

  

  scale(np.ndarray[2,]):Scale of the bounding box

  

  wrt[width,height].

  

  output_size(np.ndarray[2,]|list(2,)):Size of the

  

  destination heatmaps.

  

  use_udp(bool):Use unbiased data processing

  

  #Load tensorflow model

  

  print('-->Loading model')

  

  ret=rknn.load_tflite(model='./mobilenet_v1.tflite')

  

  if ret!=0:

  

  print('Load mobilenet_v1 failed!')

  

  exit(ret)

  

  print('done')

  

  #Build model

  

  print('-->Building model')

  

  ret=rknn.build(do_quantization=True,dataset='./dataset.txt',pre_compile=False)

  

  if ret!=0:

  

  print('Build mobilenet_v1 failed!')

  

  exit(ret)

  

  print('done')


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69973864/viewspace-2944067/,如需轉載,請註明出處,否則將追究法律責任。

相關文章