Wednesday, December 29, 2021

Error during install face recognition openCV library

Try to install face-recognition

>> 1. pip install face-recognition

The following error occurs

    ERROR: Command errored out with exit status 1:

     command: 'C:\Users\user1\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user1\\AppData\\Local\\Temp\\pip-install-8aq3akpy\\dlib_948d0b43c95149f1b66c47d668a43117\\setup.py'"'"'; __file__='"'"'C:\\Users\\user1\\AppData\\Local\\Temp\\pip-install-8aq3akpy\\dlib_948d0b43c95149f1b66c47d668a43117\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\user1\AppData\Local\Temp\pip-record-icdraszt\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\user1\AppData\Local\Programs\Python\Python310\Include\dlib'

         cwd: C:\Users\user1\AppData\Local\Temp\pip-install-8aq3akpy\dlib_948d0b43c95149f1b66c47d668a43117\

    Complete output (8 lines):

    running install

    running build

    running build_py

    package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)

    running build_ext

    ERROR: CMake must be installed to build dlib


-------------------------------------------------------------------------------------------

Install cmake first and retry to install face-recognition

>> 1. pip install cmake

Result okay.

>> 2. pip install face-recognition

Another error occurs

Collecting face-recognition

  Using cached face_recognition-1.3.0-py2.py3-none-any.whl (15 kB)

Collecting Click>=6.0

  Using cached click-8.0.3-py3-none-any.whl (97 kB)

Collecting dlib>=19.7

  Using cached dlib-19.22.1.tar.gz (7.4 MB)

  Preparing metadata (setup.py) ... done

Requirement already satisfied: Pillow in c:\users\user1\appdata\local\programs\python\python310\lib\site-packages (from face-recognition) (8.4.0)

Requirement already satisfied: face-recognition-models>=0.3.0 in c:\users\user1\appdata\local\programs\python\python310\lib\site-packages (from face-recognition) (0.3.0)

Requirement already satisfied: numpy in c:\users\user1\appdata\local\programs\python\python310\lib\site-packages (from face-recognition) (1.21.5)

Requirement already satisfied: colorama in c:\users\user1\appdata\local\programs\python\python310\lib\site-packages (from Click>=6.0->face-recognition) (0.4.4)

Using legacy 'setup.py install' for dlib, since package 'wheel' is not installed.

Installing collected packages: dlib, Click, face-recognition

    Running setup.py install for dlib ... error

    ERROR: Command errored out with exit status 1:

     command: 'C:\Users\user1\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user1\\AppData\\Local\\Temp\\pip-install-irtsarfs\\dlib_286f31435cee4d82a3d5891795f64bb6\\setup.py'"'"'; __file__='"'"'C:\\Users\\user1\\AppData\\Local\\Temp\\pip-install-irtsarfs\\dlib_286f31435cee4d82a3d5891795f64bb6\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\user1\AppData\Local\Temp\pip-record-lp8e89mp\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\user1\AppData\Local\Programs\Python\Python310\Include\dlib'

         cwd: C:\Users\user1\AppData\Local\Temp\pip-install-irtsarfs\dlib_286f31435cee4d82a3d5891795f64bb6\

    Complete output (60 lines):

    running install

    running build

    running build_py

    package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)

    running build_ext

    Building extension for Python 3.10.1 (tags/v3.10.1:2cd268a, Dec  6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)]

    Invoking CMake setup: 'cmake C:\Users\user1\AppData\Local\Temp\pip-install-irtsarfs\dlib_286f31435cee4d82a3d5891795f64bb6\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\user1\AppData\Local\Temp\pip-install-irtsarfs\dlib_286f31435cee4d82a3d5891795f64bb6\build\lib.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\user1\AppData\Local\Programs\Python\Python310\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\user1\AppData\Local\Temp\pip-install-irtsarfs\dlib_286f31435cee4d82a3d5891795f64bb6\build\lib.win-amd64-3.10 -A x64'

    -- Building for: NMake Makefiles

    CMake Error at CMakeLists.txt:5 (message):




      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



      You must use Visual Studio to build a python extension on windows.  If you

      are getting this error it means you have not installed Visual C++.  Note

      that there are many flavors of Visual Studio, like Visual Studio for C#

      development.  You need to install Visual Studio for C++.



      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!





    -- Configuring incomplete, errors occurred!

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "C:\Users\user1\AppData\Local\Temp\pip-install-irtsarfs\dlib_286f31435cee4d82a3d5891795f64bb6\setup.py", line 222, in <module>

        setup(

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 153, in setup

        return distutils.core.setup(**attrs)

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\distutils\core.py", line 148, in setup

        dist.run_commands()

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 966, in run_commands

        self.run_command(cmd)

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 985, in run_command

        cmd_obj.run()

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py", line 61, in run

        return orig.install.run(self)

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\distutils\command\install.py", line 568, in run

        self.run_command('build')

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\distutils\cmd.py", line 313, in run_command

        self.distribution.run_command(command)

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 985, in run_command

        cmd_obj.run()

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\distutils\command\build.py", line 135, in run

        self.run_command(cmd_name)

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\distutils\cmd.py", line 313, in run_command

        self.distribution.run_command(command)

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 985, in run_command

        cmd_obj.run()

      File "C:\Users\user1\AppData\Local\Temp\pip-install-irtsarfs\dlib_286f31435cee4d82a3d5891795f64bb6\setup.py", line 134, in run

        self.build_extension(ext)

      File "C:\Users\user1\AppData\Local\Temp\pip-install-irtsarfs\dlib_286f31435cee4d82a3d5891795f64bb6\setup.py", line 171, in build_extension

        subprocess.check_call(cmake_setup, cwd=build_folder)

      File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call

        raise CalledProcessError(retcode, cmd)

    subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\user1\\AppData\\Local\\Temp\\pip-install-irtsarfs\\dlib_286f31435cee4d82a3d5891795f64bb6\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\user1\\AppData\\Local\\Temp\\pip-install-irtsarfs\\dlib_286f31435cee4d82a3d5891795f64bb6\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\user1\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\user1\\AppData\\Local\\Temp\\pip-install-irtsarfs\\dlib_286f31435cee4d82a3d5891795f64bb6\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.

    ----------------------------------------

ERROR: Command errored out with exit status 1: 'C:\Users\user1\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user1\\AppData\\Local\\Temp\\pip-install-irtsarfs\\dlib_286f31435cee4d82a3d5891795f64bb6\\setup.py'"'"'; __file__='"'"'C:\\Users\\user1\\AppData\\Local\\Temp\\pip-install-irtsarfs\\dlib_286f31435cee4d82a3d5891795f64bb6\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\user1\AppData\Local\Temp\pip-record-lp8e89mp\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\user1\AppData\Local\Programs\Python\Python310\Include\dlib' Check the logs for full command output.

----------------------------------

Install visual studio for C++ and try again.





Thursday, June 25, 2015

Shortcut of RAD

Here's my list of shortcut when using RAD / Eclipse..
You can change it in the preferences.


#ShortcutsDescription
Searching / Auto-completion
1Ctrl+fSimple a find function
2Ctrl+kFind next
3Ctrl+Shift+kFind previous
4Ctrl+lGo to line x in the java file
5Ctrl+oList all methods in the java file
6F3Show source for a method or a class
7Ctrl+shift+rList of resource with your initial
8Ctrl+spaceContent assist
9Ctrl + /Single line comment by //
10Ctrl + Shift + /Multiple line comments by //
Debugging (in debug mode)
11Ctrl+bBuild All
12F6Step into
13F8Step over
Formatting / Save
14Ctrl+Shift+fCode formatting
15Ctrl+Shift+oOrganize Imports
16Ctrl+shift+sSave All

Friday, March 21, 2014

Resolved: java.lang.OutOfMemoryError: Java Heap space

When opening a large heap file, the following error occurs.
java.lang.OutOfMemoryError: Java Heap space
at com.ibm.jinwoo.heap.HeapInfo.readHAX(HeapInfo.java: 8319)
...



Solution
It would be resolved by increasing the memory for the Heap Analyzer by the following command.

java -Xmx1024m - jar ha454.jar

if it is not enough, you can try to adjust to -Xmx2048m or -Xmx4096m

Monday, December 30, 2013

[How to] How to call a function defined in the package

The following sql is to call a function defined in the package
 
declare
  outVal number;
begin
   -- Call the function
   outVal := mypackage.myfunction (100);
end;

Friday, August 9, 2013

Howto: Find the biggest value in the column

This article teaches you how to get the biggest value in the columns in the same table.

It could be done by the built-in function GREATEST

However, it does not work when there are null values in the column.

You may use NVL function as a work around.

Friday, July 19, 2013

[Resolved] Ping Connection Pool failed for XXX Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Tried to setup the connection pool for mysql in Glassfish today. The following error occurs when I tried to ping the connection pool.

Error Message
Ping Connection Pool failed for XXX Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource Please check the server.log for more details.



Solution
1. Download Connector / J
http://dev.mysql.com/downloads/connector/j/

2. Put it in the glassfish's lib folder


3. Restart the server

4. Ping Successfully!

MySQL, Glassfish 4, Connection Pool Setup

Saturday, June 29, 2013

Java compiler level does not match the version of the installed Java project facet.

Created a dynamic web project and set GlassFish 4.0 as the testing server.  The following error occured:

Java compiler level does not match the version of the installed Java project facet.


Solution:
1. Right click and choose Quick Fix
2. Change Java compiler level to 1.7

3. Done!