Monday, 30 March 2020

how to create virtual environment without conda?

python -m pip install --user virtualenv
 
cd to install location path of env
 
python -m virtualenv env 

source env/bin/activate

libgflags.a(gflags.cc.o): relocation R_X86_64_32S make pycaffe

gflags is not compiled as a shared library by default; make sure it is compiled as a shared library:
 
cd gflags/build
cmake .. -DBUILD_SHARED_LIBS=ON
make -j32
sudo make -j32 install
 
After that glog compiles fine against gflags.

Monday, 16 March 2020

How to calculate fps from elapsed time?

p/s: copy from https://stackoverflow.com/questions/43761004/fps-how-to-divide-count-by-time-function-to-determine-fps
  • Here is a very simple way to print your program's frame rate at each frame (no counter needed) :
    import time
    
    while True:
        start_time = time.time() # start time of the loop
    
        ########################
        # your fancy code here #
        ########################
    
        print("FPS: ", 1.0 / (time.time() - start_time)) # FPS = 1 / time to process loop
     
  • If you want the average frame rate over x seconds, you can do like so (counter needed) :
    import time
    
    start_time = time.time()
    x = 1 # displays the frame rate every 1 second
    counter = 0
    while True:
    
        ########################
        # your fancy code here #
        ########################
    
        counter+=1
        if (time.time() - start_time) > x :
            print("FPS: ", counter / (time.time() - start_time))
            counter = 0
            start_time = time.time()
Hope it helps!

Wednesday, 11 March 2020

cannot find -lboost_python3

cd /usr/lib/x86_64-linux-gpu

sudo ln -s libboost_python-py35.so libboost_python3.so