Skip to content

Instantly share code, notes, and snippets.

@Ruqyai
Ruqyai / MoonsTour
Last active October 20, 2018 06:44
How reset the default setting to play and stop a sound when detect a target image
/*==============================================================================
Copyright (c) 2017 PTC Inc. All Rights Reserved.
Copyright (c) 2010-2014 Qualcomm Connected Experiences, Inc.
All Rights Reserved.
Confidential and Proprietary - Protected under copyright and other laws.
==============================================================================*/
using UnityEngine;
using Vuforia;
@Ruqyai
Ruqyai / MoonsTour
Created October 20, 2018 06:48
How to rotate the earth
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RotateEarth : MonoBehaviour {
// Use this for initialization
void Start () {
}
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
"""Minimal script for generating an image using pre-trained StyleGAN generator."""
import os
!git clone https://github.com/NVlabs/stylegan.git
import sys
sys.path.insert(0, "/content/stylegan")
from IPython.display import Image
Image('/content/example.png')
# تحميل مكتبة الباندا والتنسرفلو
import pandas as pd
import tensorflow as tf
# طباعة رقم نسخة التنسرفلر
print(tf.__version__)
#downlad data from GCS and store as pandas dataframe
# تحميل البيانات (التديب والاختبار) من الروابط
data_train = pd.read_csv(
filepath_or_buffer='https://storage.googleapis.com/vijay-public/boston_housing/housing_train.csv',
FEATURES = ["CRIM", "ZN", "INDUS", "NOX", "RM",
"AGE", "DIS", "TAX", "PTRATIO"]# المميزات وهي الصفات المختارة من الأعمدة
LABEL = "MEDV" # المسمى الذي نرغب ان يتوقعه النموذح وهنا هو القيمة المتوسطة للمنازل
feature_cols = [tf.feature_column.numeric_column(k)
for k in FEATURES] #list of Feature Columns
def generate_estimator(output_dir):
return tf.estimator.DNNRegressor(feature_columns=feature_cols,
hidden_units=[10, 10],
model_dir=output_dir)
def generate_input_fn(data_set):
def input_fn():
features = {k: tf.constant(data_set[k].values) for k in FEATURES}
labels = tf.constant(data_set[LABEL].values)
return features, labels
return input_fn