Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - charles

Pages: 1 [2] 3
16
It says pycocotools can not be installed...
It requires Microsoft Visual C++ 14.0
Get it with "Build Tools for Visual Studio" : https://visualstudio.microsoft.com/downloads/


Before that, maybe you can try this:
pip install pycocotools-windows
(I got it from here: https://stackoverflow.com/questions/52920222/could-not-install-pycocotools-in-windows-fatal-error-c1083-cannot-open-include)

18
Hi jsaw, what do you see if you run pip install in the command line, instead of the notebook?

19
The images are saved in the working directory, you can specify it like this : workDir='path/to/my/dir'

By default the working directory is 'tmp' under the folder where you execute the code.
see
https://nheri-simcenter.github.io/BRAILS-Documentation/common/user_manual/workflow.html

Go to the working directory, -> images
you have StreetView and TopView folders.
The image's name indicates its location, for example: StreetViewx-93.163776x30.227985.png
which follows the pattern: StreetViewx[Longitude]x[Latitude].png
The longitude and Latitude is the centroid of its polygon, which you can find in the generated result file.



20
AI use in Regional Simulation (BRAILS) / Re: UnidentifiedImageError
« on: March 31, 2021, 08:41:00 PM »
The might be caused by an empty image, which was saved in your previous run without a working API.
Try re-run with reDownloadImgs=True

22
AI use in Regional Simulation (BRAILS) / Re: UnidentifiedImageError
« on: March 30, 2021, 11:01:20 PM »
You need to enable three APIs:

Street View Static API
Maps Static API
Geocoding API

If you still have that error, could you also share the detailed error message?


23
This is strange, not sure why anaconda wanted to install leven ...

Surprised that it required libstdc++, which has been deprecated.

Solutions:
1. Try virtualenv instead of anaconda
or
2. Try install libstdc++ manually, for example, copy the files to your corresponding folders:
https://github.com/imkiwa/xcode-missing-libstdc-

24
Hi jsaw,

It took too long to download the OSM foortprints.
This is usually caused by the temporary bad connection between your computer and OSM server.
This happened several times to me.
Could you give it another try, usually this problem goes away automatically?

Another solution is to set footPrints='Microsoft' to use Microsoft footprints.

Let me know if this works.

(also the image you attached has your private googleapikey, please consider delete this image or mask the key)

25
Site Response Analysis (s3hark) / Re: Plot results / model
« on: January 26, 2021, 05:16:29 PM »
Hi Marco,

Thanks for your question.
1) Exporting .xlsx files is not supported yet. We'll add this feature soon.
2) S3hark create an effective stress site response analysis finite element model, with dashpots at the base.

There are two options to solve the FE model:

In the 'Configure' tab, if you left the OpenSees path empty by default, S3hark will solve the model internally.

If you provided the OpenSees path there, S3hark will create a tcl file and call your OpenSees to run it.
This tcl file can be found in
macOS: ~/Library/Application Support/SimCenter/s3hark/analysis/
Windows: C:/Users/<USER>/AppData/Roaming/SimCenter/s3hark/analysis/



26
Hi Amir,

Thanks for your question.
This error is caused by two dependencies - Fiona and GDAL, installing them on Windows with pip is problematic.

Base on our email communications, your solution is to switch to conda as your python environment.

I'm putting here another solution, which doesn't need conda.
Instead, we download Fiona and GDAL's wheel files (https://www.lfd.uci.edu/~gohlke/pythonlibs/) and manually install them.


For example, if you are using Python3.8:

1. Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/ and download

GDAL-3.1.4-cp38-cp38-win_amd64.whl and
Fiona-1.8.18-cp38-cp38-win_amd64.whl


here cp38 means python3.8.

2. pip install GDAL-3.1.4-cp38-cp38-win_amd64.whl

3. pip install Fiona-1.8.18-cp38-cp38-win_amd64.whl


Then you'll be able to:
pip install BRAILS

 :)





27
Spatial Uncertainty Research Framework (SURF) / An example
« on: August 06, 2020, 05:23:27 AM »
In the document there is an example showing how to use SURF to learn the pattern in a dataset, and use the learned knowledge to enhance the original dataset.

The example codes are as follows, but you can also run it in Golab notebook: [https://colab.research.google.com/github/NHERI-SimCenter/SURF/blob/master/examples/demo-NN.ipynb]

Code: [Select]
import os
import wget
import zipfile
import shutil
import csv
import numpy as np

import matplotlib.cm as cm
import matplotlib.pyplot as plt
import matplotlib.colors as colors

#---------------------------------------------------------------------------------------
# 0. Download data
#---------------------------------------------------------------------------------------

url = 'https://berkeley.box.com/shared/static/jbvyu0ng0zrt75il3ps1qygwellpr8c5.zip'
workDir = 'tmp'
fileName = 'AnchorageBuildings.zip'
print('Beginning file download with wget module')
wget.download(url, fileName)
print('\nFile downloaded. \n')

with zipfile.ZipFile(fileName, 'r') as zip_ref:
    zip_ref.extractall('tmp')

try:
    dest = shutil.move(fileName, workDir+'/')
except:
    os.remove(workDir+'/'+fileName)
    dest = shutil.move(fileName, workDir+'/')


#---------------------------------------------------------------------------------------
# 1. Prepare data
#---------------------------------------------------------------------------------------

BIMFileName = 'tmp/AnchorageBuildings.csv'

# read raw data
data = []
with open(BIMFileName, newline='') as csvfile:
    reader = csv.DictReader(csvfile)
    for row in reader:
        lat = float(row['Latitude'])
        lon = float(row['Longitude'])
        yearbuilt = int(float(row['Year Built']) )
        if lat>61.05 and lat<61.2 and lon>-150. and lon<-149.7:
            data.append([lon, lat, yearbuilt])

# data is a numpy matrix with columns: [x,y,value]
data = np.array(data)


#---------------------------------------------------------------------------------------
# 2. Train a neural network
#---------------------------------------------------------------------------------------
from surf.NN import SpatialNeuralNet


# define a spatial neural network
# numNei is the number of nearest neighbors to be considered
# writeTmpData is true so that temporary files are written down in ./tmp
nn = SpatialNeuralNet(rawData = data, numNei = 2, writeTmpData=True)
nn.build_model()
nn.train()


#---------------------------------------------------------------------------------------
# 3. Test the neural network
#---------------------------------------------------------------------------------------

nn.test()


28
Dear users, Welcome!

If you have any question about SURF, please click "NEW TOPIC" and create a new post.
I'll receive your question timely.

You can include files, images in your post by clicking "Attachments and other options".

Have fun! :) :)  ;)

29
We recently released a building inventory dataset generated by BRAILS.

It is formatted in HAZUS style and can be found in this link: https://github.com/NHERI-SimCenter/BRAILS/tree/master/docs/datarelease


30
Dear users, Welcome!

If you have any question about BRAILS, please click "NEW TOPIC" and create a new post.
I'll receive your question timely.

You can include files, images in your post by clicking "Attachments and other options".

Have fun! :) :) :)

Pages: 1 [2] 3